Index: llvm/trunk/lib/LTO/LTO.cpp =================================================================== --- llvm/trunk/lib/LTO/LTO.cpp +++ llvm/trunk/lib/LTO/LTO.cpp @@ -380,6 +380,11 @@ const SymbolResolution *ResE) { // FIXME: move to backend Module &M = *IM.Mod; + + if (M.getDataLayoutStr().empty()) + return make_error("input module has no datalayout", + inconvertibleErrorCode()); + if (!Conf.OverrideTriple.empty()) M.setTargetTriple(Conf.OverrideTriple); else if (M.getTargetTriple().empty()) Index: llvm/trunk/lib/LTO/LTOBackend.cpp =================================================================== --- llvm/trunk/lib/LTO/LTOBackend.cpp +++ llvm/trunk/lib/LTO/LTOBackend.cpp @@ -191,7 +191,6 @@ 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 Index: llvm/trunk/lib/LTO/LTOModule.cpp =================================================================== --- llvm/trunk/lib/LTO/LTOModule.cpp +++ llvm/trunk/lib/LTO/LTOModule.cpp @@ -233,7 +233,6 @@ TargetMachine *target = march->createTargetMachine(TripleStr, CPU, FeatureStr, options, None); - M->setDataLayout(target->createDataLayout()); std::unique_ptr Ret(new LTOModule(std::move(M), Buffer, target)); Ret->parseSymbols(); Index: llvm/trunk/test/LTO/Resolution/X86/Inputs/common2.ll =================================================================== --- llvm/trunk/test/LTO/Resolution/X86/Inputs/common2.ll +++ llvm/trunk/test/LTO/Resolution/X86/Inputs/common2.ll @@ -1,7 +1,8 @@ -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 +} Index: llvm/trunk/test/LTO/Resolution/X86/Inputs/mixed_lto.ll =================================================================== --- llvm/trunk/test/LTO/Resolution/X86/Inputs/mixed_lto.ll +++ llvm/trunk/test/LTO/Resolution/X86/Inputs/mixed_lto.ll @@ -1,3 +1,4 @@ +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() { Index: llvm/trunk/test/LTO/Resolution/X86/common2.ll =================================================================== --- llvm/trunk/test/LTO/Resolution/X86/common2.ll +++ llvm/trunk/test/LTO/Resolution/X86/common2.ll @@ -70,9 +70,8 @@ ; 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 Index: llvm/trunk/test/LTO/Resolution/X86/mixed_lto.ll =================================================================== --- llvm/trunk/test/LTO/Resolution/X86/mixed_lto.ll +++ llvm/trunk/test/LTO/Resolution/X86/mixed_lto.ll @@ -19,6 +19,7 @@ ; 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 Index: llvm/trunk/test/LTO/X86/diagnostic-handler-remarks-with-hotness.ll =================================================================== --- llvm/trunk/test/LTO/X86/diagnostic-handler-remarks-with-hotness.ll +++ llvm/trunk/test/LTO/X86/diagnostic-handler-remarks-with-hotness.ll @@ -19,6 +19,7 @@ ; 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() Index: llvm/trunk/test/LTO/X86/diagnostic-handler-remarks.ll =================================================================== --- llvm/trunk/test/LTO/X86/diagnostic-handler-remarks.ll +++ llvm/trunk/test/LTO/X86/diagnostic-handler-remarks.ll @@ -54,6 +54,7 @@ ; 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() Index: llvm/trunk/test/LTO/X86/no-undefined-puts-when-implemented.ll =================================================================== --- llvm/trunk/test/LTO/X86/no-undefined-puts-when-implemented.ll +++ llvm/trunk/test/LTO/X86/no-undefined-puts-when-implemented.ll @@ -5,6 +5,7 @@ ; 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" Index: llvm/trunk/test/LTO/X86/triple-init.ll =================================================================== --- llvm/trunk/test/LTO/X86/triple-init.ll +++ llvm/trunk/test/LTO/X86/triple-init.ll @@ -2,8 +2,7 @@ ; 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) Index: llvm/trunk/test/ThinLTO/X86/Inputs/distributed_import.ll =================================================================== --- llvm/trunk/test/ThinLTO/X86/Inputs/distributed_import.ll +++ llvm/trunk/test/ThinLTO/X86/Inputs/distributed_import.ll @@ -1,3 +1,5 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" + @G = internal global i32 7 define i32 @g() { entry: Index: llvm/trunk/test/ThinLTO/X86/distributed_import.ll =================================================================== --- llvm/trunk/test/ThinLTO/X86/distributed_import.ll +++ llvm/trunk/test/ThinLTO/X86/distributed_import.ll @@ -11,6 +11,8 @@ ; 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() { Index: llvm/trunk/test/tools/gold/X86/Inputs/alias-1.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/alias-1.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/alias-1.ll @@ -1 +1,3 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" + @a = global i32 42 Index: llvm/trunk/test/tools/gold/X86/Inputs/available-externally.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/available-externally.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/available-externally.ll @@ -1,3 +1,5 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" + define void @zed() { ret void } Index: llvm/trunk/test/tools/gold/X86/Inputs/cache.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/cache.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/cache.ll @@ -1,3 +1,4 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" define i32 @main() { Index: llvm/trunk/test/tools/gold/X86/Inputs/comdat.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/comdat.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/comdat.ll @@ -1,3 +1,5 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" + $c2 = comdat any $c1 = comdat any Index: llvm/trunk/test/tools/gold/X86/Inputs/comdat2.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/comdat2.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/comdat2.ll @@ -1,3 +1,5 @@ +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() { Index: llvm/trunk/test/tools/gold/X86/Inputs/common.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/common.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/common.ll @@ -1 +1,3 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" + @a = common global i32 0, align 4 Index: llvm/trunk/test/tools/gold/X86/Inputs/common2.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/common2.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/common2.ll @@ -1 +1,3 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" + @a = common global i8 0, align 16 Index: llvm/trunk/test/tools/gold/X86/Inputs/common3.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/common3.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/common3.ll @@ -1 +1,3 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" + @a = common global i8 0, align 1 Index: llvm/trunk/test/tools/gold/X86/Inputs/ctors2.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/ctors2.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/ctors2.ll @@ -1,3 +1,5 @@ +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() { Index: llvm/trunk/test/tools/gold/X86/Inputs/drop-linkage.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/drop-linkage.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/drop-linkage.ll @@ -1,3 +1,5 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" + $foo = comdat any define linkonce void @foo() comdat { ret void Index: llvm/trunk/test/tools/gold/X86/Inputs/irmover-error.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/irmover-error.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/irmover-error.ll @@ -1,3 +1,5 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" + !0 = !{ i32 1, !"foo", i32 2 } !llvm.module.flags = !{ !0 } Index: llvm/trunk/test/tools/gold/X86/Inputs/linkonce-weak.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/linkonce-weak.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/linkonce-weak.ll @@ -1,3 +1,5 @@ +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 } Index: llvm/trunk/test/tools/gold/X86/Inputs/mixed_lto.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/mixed_lto.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/mixed_lto.ll @@ -1,3 +1,4 @@ +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() { Index: llvm/trunk/test/tools/gold/X86/Inputs/pr19901-1.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/pr19901-1.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/pr19901-1.ll @@ -1,3 +1,4 @@ +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 Index: llvm/trunk/test/tools/gold/X86/Inputs/resolve-to-alias.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/resolve-to-alias.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/resolve-to-alias.ll @@ -1,3 +1,5 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" + @bar = alias void (), void ()* @zed define void @zed() { ret void Index: llvm/trunk/test/tools/gold/X86/Inputs/start-lib-common.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/start-lib-common.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/start-lib-common.ll @@ -1 +1,3 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" + @x = common global i32 0, align 8 Index: llvm/trunk/test/tools/gold/X86/Inputs/thinlto.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/thinlto.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/thinlto.ll @@ -1,3 +1,5 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" + define void @g() { entry: ret void Index: llvm/trunk/test/tools/gold/X86/Inputs/thinlto_alias.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/thinlto_alias.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/thinlto_alias.ll @@ -1,3 +1,4 @@ +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: Index: llvm/trunk/test/tools/gold/X86/Inputs/thinlto_archive1.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/thinlto_archive1.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/thinlto_archive1.ll @@ -1,3 +1,5 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" + define void @g() { entry: ret void Index: llvm/trunk/test/tools/gold/X86/Inputs/thinlto_archive2.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/thinlto_archive2.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/thinlto_archive2.ll @@ -1,3 +1,5 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" + define void @h() { entry: ret void Index: llvm/trunk/test/tools/gold/X86/Inputs/thinlto_empty.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/thinlto_empty.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/thinlto_empty.ll @@ -0,0 +1 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" Index: llvm/trunk/test/tools/gold/X86/Inputs/thinlto_internalize.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/thinlto_internalize.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/thinlto_internalize.ll @@ -1,3 +1,4 @@ +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() { Index: llvm/trunk/test/tools/gold/X86/Inputs/thinlto_linkonceresolution.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/thinlto_linkonceresolution.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/thinlto_linkonceresolution.ll @@ -1,3 +1,4 @@ +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 Index: llvm/trunk/test/tools/gold/X86/Inputs/thinlto_weak_resolution.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/thinlto_weak_resolution.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/thinlto_weak_resolution.ll @@ -1,3 +1,4 @@ +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 Index: llvm/trunk/test/tools/gold/X86/Inputs/type-merge.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/type-merge.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/type-merge.ll @@ -1,3 +1,5 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" + define void @zed() { call void @bar() ret void Index: llvm/trunk/test/tools/gold/X86/Inputs/type-merge2.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/type-merge2.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/type-merge2.ll @@ -1,3 +1,5 @@ +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 Index: llvm/trunk/test/tools/gold/X86/Inputs/visibility.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/visibility.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/visibility.ll @@ -1,3 +1,5 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" + define void @foo() { ret void } Index: llvm/trunk/test/tools/gold/X86/Inputs/weak.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/Inputs/weak.ll +++ llvm/trunk/test/tools/gold/X86/Inputs/weak.ll @@ -1,2 +1,4 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" + @a = weak global i32 41 @c = global i32* @a Index: llvm/trunk/test/tools/gold/X86/alias.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/alias.ll +++ llvm/trunk/test/tools/gold/X86/alias.ll @@ -9,5 +9,7 @@ ; 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 Index: llvm/trunk/test/tools/gold/X86/alias2.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/alias2.ll +++ llvm/trunk/test/tools/gold/X86/alias2.ll @@ -2,6 +2,8 @@ ; 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() Index: llvm/trunk/test/tools/gold/X86/available-externally.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/available-externally.ll +++ llvm/trunk/test/tools/gold/X86/available-externally.ll @@ -11,6 +11,8 @@ ; 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() Index: llvm/trunk/test/tools/gold/X86/bad-alias.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/bad-alias.ll +++ llvm/trunk/test/tools/gold/X86/bad-alias.ll @@ -6,6 +6,8 @@ ; 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 Index: llvm/trunk/test/tools/gold/X86/bcsection.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/bcsection.ll +++ llvm/trunk/test/tools/gold/X86/bcsection.ll @@ -5,6 +5,7 @@ ; 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 Index: llvm/trunk/test/tools/gold/X86/cache.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/cache.ll +++ llvm/trunk/test/tools/gold/X86/cache.ll @@ -24,6 +24,7 @@ ; 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 { Index: llvm/trunk/test/tools/gold/X86/coff.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/coff.ll +++ llvm/trunk/test/tools/gold/X86/coff.ll @@ -3,7 +3,7 @@ ; 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() { Index: llvm/trunk/test/tools/gold/X86/comdat.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/comdat.ll +++ llvm/trunk/test/tools/gold/X86/comdat.ll @@ -5,6 +5,8 @@ ; 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) Index: llvm/trunk/test/tools/gold/X86/comdat2.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/comdat2.ll +++ llvm/trunk/test/tools/gold/X86/comdat2.ll @@ -5,6 +5,7 @@ ; 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 Index: llvm/trunk/test/tools/gold/X86/common.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/common.ll +++ llvm/trunk/test/tools/gold/X86/common.ll @@ -3,6 +3,8 @@ ; 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 \ Index: llvm/trunk/test/tools/gold/X86/ctors.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/ctors.ll +++ llvm/trunk/test/tools/gold/X86/ctors.ll @@ -4,6 +4,8 @@ ; 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() { Index: llvm/trunk/test/tools/gold/X86/ctors2.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/ctors2.ll +++ llvm/trunk/test/tools/gold/X86/ctors2.ll @@ -5,6 +5,8 @@ ; 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() { Index: llvm/trunk/test/tools/gold/X86/disable-verify.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/disable-verify.ll +++ llvm/trunk/test/tools/gold/X86/disable-verify.ll @@ -10,6 +10,7 @@ ; 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 Index: llvm/trunk/test/tools/gold/X86/drop-linkage.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/drop-linkage.ll +++ llvm/trunk/test/tools/gold/X86/drop-linkage.ll @@ -7,6 +7,8 @@ ; 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 } Index: llvm/trunk/test/tools/gold/X86/emit-llvm.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/emit-llvm.ll +++ llvm/trunk/test/tools/gold/X86/emit-llvm.ll @@ -22,6 +22,7 @@ ; 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 Index: llvm/trunk/test/tools/gold/X86/irmover-error.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/irmover-error.ll +++ llvm/trunk/test/tools/gold/X86/irmover-error.ll @@ -4,6 +4,8 @@ ; 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 } Index: llvm/trunk/test/tools/gold/X86/linker-script.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/linker-script.ll +++ llvm/trunk/test/tools/gold/X86/linker-script.ll @@ -6,6 +6,8 @@ ; 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 Index: llvm/trunk/test/tools/gold/X86/linkonce-weak.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/linkonce-weak.ll +++ llvm/trunk/test/tools/gold/X86/linkonce-weak.ll @@ -11,6 +11,8 @@ ; 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 } Index: llvm/trunk/test/tools/gold/X86/mixed_lto.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/mixed_lto.ll +++ llvm/trunk/test/tools/gold/X86/mixed_lto.ll @@ -12,6 +12,7 @@ ; 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 Index: llvm/trunk/test/tools/gold/X86/no-map-whole-file.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/no-map-whole-file.ll +++ llvm/trunk/test/tools/gold/X86/no-map-whole-file.ll @@ -4,6 +4,9 @@ ; 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 } Index: llvm/trunk/test/tools/gold/X86/opt-level.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/opt-level.ll +++ llvm/trunk/test/tools/gold/X86/opt-level.ll @@ -12,6 +12,9 @@ ; 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 } Index: llvm/trunk/test/tools/gold/X86/parallel.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/parallel.ll +++ llvm/trunk/test/tools/gold/X86/parallel.ll @@ -6,6 +6,7 @@ ; 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 Index: llvm/trunk/test/tools/gold/X86/pr19901.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/pr19901.ll +++ llvm/trunk/test/tools/gold/X86/pr19901.ll @@ -15,6 +15,7 @@ ; 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() Index: llvm/trunk/test/tools/gold/X86/pr19901_thinlto.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/pr19901_thinlto.ll +++ llvm/trunk/test/tools/gold/X86/pr19901_thinlto.ll @@ -16,6 +16,7 @@ ; 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() Index: llvm/trunk/test/tools/gold/X86/pr25907.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/pr25907.ll +++ llvm/trunk/test/tools/gold/X86/pr25907.ll @@ -4,6 +4,8 @@ ; 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 { Index: llvm/trunk/test/tools/gold/X86/pr25915.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/pr25915.ll +++ llvm/trunk/test/tools/gold/X86/pr25915.ll @@ -5,6 +5,8 @@ ; 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} Index: llvm/trunk/test/tools/gold/X86/relax-relocs.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/relax-relocs.ll +++ llvm/trunk/test/tools/gold/X86/relax-relocs.ll @@ -7,6 +7,7 @@ ; 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 Index: llvm/trunk/test/tools/gold/X86/resolve-to-alias.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/resolve-to-alias.ll +++ llvm/trunk/test/tools/gold/X86/resolve-to-alias.ll @@ -15,6 +15,8 @@ ; 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 Index: llvm/trunk/test/tools/gold/X86/slp-vectorize.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/slp-vectorize.ll +++ llvm/trunk/test/tools/gold/X86/slp-vectorize.ll @@ -8,6 +8,7 @@ ; 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) { Index: llvm/trunk/test/tools/gold/X86/start-lib-common.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/start-lib-common.ll +++ llvm/trunk/test/tools/gold/X86/start-lib-common.ll @@ -9,6 +9,7 @@ ; 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 Index: llvm/trunk/test/tools/gold/X86/strip_names.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/strip_names.ll +++ llvm/trunk/test/tools/gold/X86/strip_names.ll @@ -24,6 +24,8 @@ ; 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) { Index: llvm/trunk/test/tools/gold/X86/thinlto.ll =================================================================== --- llvm/trunk/test/tools/gold/X86/thinlto.ll +++ llvm/trunk/test/tools/gold/X86/thinlto.ll @@ -115,6 +115,8 @@ ; COMBINED-NEXT: