const SymbolResolution *ResE) {
// FIXME: move to backend
Module &M = *IM.Mod;
+
+ if (M.getDataLayoutStr().empty())
+ return make_error<StringError>("input module has no datalayout",
+ inconvertibleErrorCode());
+
if (!Conf.OverrideTriple.empty())
M.setTargetTriple(Conf.OverrideTriple);
else if (M.getTargetTriple().empty())
bool opt(Config &Conf, TargetMachine *TM, unsigned Task, Module &Mod,
bool IsThinLTO) {
- Mod.setDataLayout(TM->createDataLayout());
if (Conf.OptPipeline.empty())
runOldPMPasses(Conf, Mod, TM, IsThinLTO);
else
TargetMachine *target =
march->createTargetMachine(TripleStr, CPU, FeatureStr, options, None);
- M->setDataLayout(target->createDataLayout());
std::unique_ptr<LTOModule> Ret(new LTOModule(std::move(M), Buffer, target));
Ret->parseSymbols();
-target triple = "x86_64-apple-macosx10.11.0"
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
@v = common global i16 0, align 4
define i16 *@bar() {
ret i16 *@v
-}
\ No newline at end of file
+}
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
declare i32 @g()
define i32 @main() {
; RUN: -r %t2.bc,bar,px
; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=BOTH-PREVAILED2
-
-
-target triple = "x86_64-apple-macosx10.11.0"
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
@v = common global i8 0, align 8
; RUN: llvm-nm %t5.o.0 | FileCheck %s --check-prefix=NM0
; RUN: llvm-nm %t5.o.1 | FileCheck %s --check-prefix=NM1
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @g() {
ret i32 0
; YAML-NEXT: - Caller: main
; YAML-NEXT: ...
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-darwin"
declare i32 @bar()
; YAML-NEXT: - Caller: main
; YAML-NEXT: ...
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-darwin"
declare i32 @bar()
; rdar://problem/16165191
; runtime library implementations should not be renamed
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-darwin11"
@str = private unnamed_addr constant [13 x i8] c"hello world\0A\00"
; RUN: llvm-lto -exported-symbol=_main -o %t2 %t1
; RUN: llvm-nm %t2 | FileCheck %s
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
-
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.9"
declare double @pow(double, double)
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
@G = internal global i32 7
define i32 @g() {
entry:
; RUN: llvm-dis -o - %t2.out | FileCheck %s
; CHECK: @G.llvm.0
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
declare i32 @g(...)
define void @f() {
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
@a = global i32 42
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
define void @zed() {
ret void
}
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @main() {
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
$c2 = comdat any
$c1 = comdat any
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
$foo = comdat any
@foo = global i8 1, comdat
define void @zed() {
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
@a = common global i32 0, align 4
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
@a = common global i8 0, align 16
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
@a = common global i8 0, align 1
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @bar, i8* null }]
define void @bar() {
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
$foo = comdat any
define linkonce void @foo() comdat {
ret void
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
!0 = !{ i32 1, !"foo", i32 2 }
!llvm.module.flags = !{ !0 }
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
define weak_odr void @f() !dbg !4 {
ret void, !dbg !10
}
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
declare i32 @g()
define i32 @main() {
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define linkonce_odr hidden void @f() {
ret void
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
@bar = alias void (), void ()* @zed
define void @zed() {
ret void
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
@x = common global i32 0, align 8
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
define void @g() {
entry:
ret void
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define weak void @weakfunc() {
entry:
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
define void @g() {
entry:
ret void
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
define void @h() {
entry:
ret void
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
declare i32 @g()
define i32 @main() {
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define linkonce_odr hidden void @f() {
ret void
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; Alias are not optimized
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
define void @zed() {
call void @bar()
ret void
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
%zed = type { i16 }
define void @bar(%zed* %this) {
store %zed* %this, %zed** null
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
define void @foo() {
ret void
}
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
@a = weak global i32 41
@c = global i32* @a
; CHECK-NEXT: @b = global i32 1
; CHECK-NOT: alias
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
@a = weak alias i32, i32* @b
@b = global i32 1
; RUN: %gold -shared -o %t2.bc -plugin %llvmshlibdir/LLVMgold.so %t.o -plugin-opt=emit-llvm
; RUN: llvm-dis %t2.bc -o - | FileCheck %s
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
@bar = alias void (), void ()* @zed
define void @foo() {
call void @bar()
; RUN: -shared %t2.o %t.o -o %t3.o
; RUN: llvm-dis %t3.o -o - | FileCheck %s
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
define void @foo() {
call void @bar()
call void @zed()
; CHECK: Unable to determine comdat of alias!
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
@g1 = global i32 1
@g2 = global i32 2
; RUN: %gold -r -o %T/bcsection.o -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold.so %T/bcsection.bco
; RUN: llvm-nm -no-llvm-bc %T/bcsection.o | FileCheck %s
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-unknown"
; CHECK: main
; RUN: ls %t.cache | count 2
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define void @globalfunc() #0 {
; RUN: -shared %t.o -o %t2.o
; RUN: llvm-dis %t2.o -o - | FileCheck %s
-
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target datalayout = "m:w"
; CHECK: define void @f() {
; RUN: FileCheck --check-prefix=RES %s < %t3.o.resolution.txt
; RUN: llvm-readobj -t %t3.o | FileCheck --check-prefix=OBJ %s
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
$c1 = comdat any
@v1 = weak_odr global i32 42, comdat($c1)
; RUN: -shared %t.bc %t2.bc -o %t3.bc
; RUN: llvm-dis %t3.bc -o - | FileCheck %s
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
$foo = comdat any
@foo = global i8 0, comdat
; RUN: llvm-as %p/Inputs/common2.ll -o %t2b.o
; RUN: llvm-as %p/Inputs/common3.ll -o %t2c.o
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
@a = common global i16 0, align 8
; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \
; RUN: -shared %t.o -o %t2.o
; RUN: llvm-dis %t2.o -o - | FileCheck %s
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @foo, i8* null }]
define internal void @foo() {
; RUN: -shared %t.o %t2.o -o %t3.o
; RUN: llvm-dis %t3.o -o - | FileCheck %s
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @foo, i8* null }]
define void @foo() {
; RUN: --plugin-opt=-debug-pass=Arguments \
; RUN: -shared %t.o -o %t2.o 2>&1 | FileCheck %s -check-prefix=VERIFY
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; -disable-verify should disable output verification from the optimization
; RUN: -shared %t.o %t2.o -o %t3.o
; RUN: llvm-dis %t3.o -o - | FileCheck %s
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
define void @foo() {
ret void
}
; NM: T f3
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; CHECK-DAG: @g1 = weak_odr constant i32 32
; CHECK: fatal error: Failed to link module {{.*}}2.bc: linking module flags 'foo': IDs have conflicting values
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
!0 = !{ i32 1, !"foo", i32 1 }
!llvm.module.flags = !{ !0 }
; RUN: -version-script=%p/Inputs/linker-script.export
; RUN: llvm-dis %t2.o -o - | FileCheck %s
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
; CHECK: define void @f()
define void @f() {
ret void
; RUN: -shared %t2.o %t.o -o %t3.o
; RUN: llvm-dis %t3.o -o - | FileCheck %s
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
define linkonce_odr void @f() !dbg !4 {
ret void, !dbg !10
}
; CHECK-DAG: T main
; CHECK-DAG: T g
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @g() {
ret i32 0
; RUN: llvm-dis < %t2.bc -o - | FileCheck %s
; CHECK: main
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
define i32 @main() {
ret i32 0
}
; CHECK-O0: define internal void @foo(
; CHECK-O1: define internal void @foo(
; CHECK-O2-NOT: define internal void @foo(
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
define internal void @foo() {
ret void
}
; RUN: llvm-nm %t.o0 | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-nm %t.o1 | FileCheck --check-prefix=CHECK1 %s
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; CHECK-BC0: define void @foo
; CHECK: Section: .text
; CHECK-NEXT: }
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @g() {
call void @f()
; CHECK: Section: .text
; CHECK-NEXT: }
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @g() {
call void @f()
; RUN: llvm-nm %t2 | FileCheck %s
; CHECK: T main
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
@main.L = internal unnamed_addr constant [3 x i8*] [i8* blockaddress(@main, %L1), i8* blockaddress(@main, %L2), i8* null], align 16
define i32 @main() #0 {
; RUN: llvm-dis %t2 -o - | FileCheck %s
; CHECK-NOT: subprograms
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4}
!llvm.ident = !{!5}
; Test that we produce R_X86_64_GOTPCREL instead of R_X86_64_GOTPCRELX
; CHECK: R_X86_64_GOTPCREL foo
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@foo = external global i32
; RUN: FileCheck --check-prefix=PASS1 %s < %t.ll
; RUN: FileCheck --check-prefix=PASS2 %s < %t.ll
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
define void @foo() {
call void @bar()
ret void
; test that the vectorizer is run.
; CHECK: fadd <4 x float>
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define void @f(float* nocapture %x) {
; RUN: -shared %t1.o --start-lib %t2.o --end-lib -o %t3.o
; RUN: llvm-dis %t3.o -o - | FileCheck %s
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@x = common global i32 0, align 4
; ToT gold (as of 03/2016) honors --start-lib/--end-lib, drops %t2.o and ends up
; NONAME: %3 = add i32 %0, %2
; NONAME: ret i32 %3
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
@GlobalValueName = global i32 0
define i32 @foo(i32 %in) {
; COMBINED-NEXT: <COMBINED_ENTRY abbrevid={{[0-9]+}} op0={{1|2}} op1={{-3706093650706652785|-5300342847281564238}}
; COMBINED-NEXT: </VALUE_SYMTAB
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
declare void @g(...)
define void @f() {
; OPT: define hidden void @weakfunc.llvm.0()
; OPT2: define weak void @weakfunc()
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@weakfuncAlias = alias void (...), bitcast (void ()* @weakfunc to void (...)*)
; RUN: -shared %t.o %t.a -o %t4 2>&1 | FileCheck %s
; RUN: llvm-nm %t4 | FileCheck %s --check-prefix=NM
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
; CHECK-DAG: Import g
declare void @g(...)
; CHECK-DAG: Import h
; The index file should be created even for the input with an empty summary.
; RUN: ls %t3.o.thinlto.bc
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
declare void @g(...)
define void @f() {
; h() should be internalized after promotion, and eliminated after inlining
; CHECK-NOT: @h.llvm.
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @g() {
call void @f()
; OPT-NOT: @f()
; OPT2: define weak_odr hidden void @f()
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @g() {
call void @f()
; RUN: -shared %T/oldpath/thinlto_prefix_replace.o -o %T/thinlto_prefix_replace
; RUN: ls %T/newpath/thinlto_prefix_replace.o.thinlto.bc
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
define void @f() {
entry:
ret void
; RUN: llvm-dis %t.o.3.import.bc -o - | FileCheck --check-prefix=IMPORT %s
; RUN llvm-dis %t2.o.3.import.bc -o - | FileCheck --check-prefix=IMPORT2 %s
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; RUN: -shared %t.o %t2.o -o %t3.o
; RUN: llvm-dis %t3.o -o - | FileCheck %s
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
define void @foo() {
call void @bar(i8* null)
ret void
; RUN: -shared %t.o %t2.o -o %t3.o
; RUN: llvm-dis %t3.o.0.2.internalize.bc -o - | FileCheck %s
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
%zed = type { i8 }
define void @foo() {
call void @bar(%zed* null)
; RUN: -shared %t.o -o %t2.o
; RUN: llvm-dis %t2.o -o - | FileCheck %s
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
@a = internal unnamed_addr constant i8 42
define i8* @f() {
; IR: define void @foo
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
define weak protected void @foo() {
ret void
}
; RUN: -shared %t.o %t2.o -o %t3.o
; RUN: llvm-dis %t3.o -o - | FileCheck %s
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
@a = weak global i32 42
@b = global i32* @a
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
define void @g() {
entry:
ret void
; COMBINED-NEXT: <COMBINED_ENTRY abbrevid={{[0-9]+}} op0={{1|2}} op1={{-3706093650706652785|-5300342847281564238}}
; COMBINED-NEXT: </VALUE_SYMTAB
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
define void @f() {
entry:
ret void
--- /dev/null
+; RUN: llvm-as < %s > %t1.bc
+
+; Reject input modules without a datalayout.
+; RUN: not llvm-lto2 %t1.bc -o %t.o \
+; RUN: -r %t1.bc,patatino,px 2>&1 | FileCheck %s
+
+; CHECK: input module has no datalayout
+
+target triple = "x86_64-unknown-linux-gnu"
+
+define void @patatino() {
+ ret void
+}
; RUN: -aa-pipeline basic-aa
; RUN: llvm-dis < %t.o.0.4.opt.bc | FileCheck %s --check-prefix=CUSTOM
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define void @patatino() {
; ERR2: unused symbol resolution for {{.*}}.bc,bar
; ERR3: invalid character q in resolution: {{.*}}.bc,foo
; ERR4: invalid resolution: foo
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
@foo = global i32 0