summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2016-12-14 21:57:04 +0000
committerDavide Italiano <davide@freebsd.org>2016-12-14 21:57:04 +0000
commit6b673b85edb18561b5008276da2700a323b41111 (patch)
tree42f4e6311d5167096740743ae774bdfaa9cf2122
parent62776a860a657b30007c0b24d9341bc405d3afa4 (diff)
[LTO] Reject modules without datalayout.
Also, udpate the ~60 failing tests in the tree which did not contain a valid datalayout. This fixes PR31123. lld will be updated in a following patch, immediately after this is committed. Differential Revision: https://reviews.llvm.org/D27082 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289719 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/LTO/LTO.cpp5
-rw-r--r--lib/LTO/LTOBackend.cpp1
-rw-r--r--lib/LTO/LTOModule.cpp1
-rw-r--r--test/LTO/Resolution/X86/Inputs/common2.ll5
-rw-r--r--test/LTO/Resolution/X86/Inputs/mixed_lto.ll1
-rw-r--r--test/LTO/Resolution/X86/common2.ll5
-rw-r--r--test/LTO/Resolution/X86/mixed_lto.ll1
-rw-r--r--test/LTO/X86/diagnostic-handler-remarks-with-hotness.ll1
-rw-r--r--test/LTO/X86/diagnostic-handler-remarks.ll1
-rw-r--r--test/LTO/X86/no-undefined-puts-when-implemented.ll1
-rw-r--r--test/LTO/X86/triple-init.ll3
-rw-r--r--test/ThinLTO/X86/Inputs/distributed_import.ll2
-rw-r--r--test/ThinLTO/X86/distributed_import.ll2
-rw-r--r--test/tools/gold/X86/Inputs/alias-1.ll2
-rw-r--r--test/tools/gold/X86/Inputs/available-externally.ll2
-rw-r--r--test/tools/gold/X86/Inputs/cache.ll1
-rw-r--r--test/tools/gold/X86/Inputs/comdat.ll2
-rw-r--r--test/tools/gold/X86/Inputs/comdat2.ll2
-rw-r--r--test/tools/gold/X86/Inputs/common.ll2
-rw-r--r--test/tools/gold/X86/Inputs/common2.ll2
-rw-r--r--test/tools/gold/X86/Inputs/common3.ll2
-rw-r--r--test/tools/gold/X86/Inputs/ctors2.ll2
-rw-r--r--test/tools/gold/X86/Inputs/drop-linkage.ll2
-rw-r--r--test/tools/gold/X86/Inputs/irmover-error.ll2
-rw-r--r--test/tools/gold/X86/Inputs/linkonce-weak.ll2
-rw-r--r--test/tools/gold/X86/Inputs/mixed_lto.ll1
-rw-r--r--test/tools/gold/X86/Inputs/pr19901-1.ll1
-rw-r--r--test/tools/gold/X86/Inputs/resolve-to-alias.ll2
-rw-r--r--test/tools/gold/X86/Inputs/start-lib-common.ll2
-rw-r--r--test/tools/gold/X86/Inputs/thinlto.ll2
-rw-r--r--test/tools/gold/X86/Inputs/thinlto_alias.ll1
-rw-r--r--test/tools/gold/X86/Inputs/thinlto_archive1.ll2
-rw-r--r--test/tools/gold/X86/Inputs/thinlto_archive2.ll2
-rw-r--r--test/tools/gold/X86/Inputs/thinlto_empty.ll1
-rw-r--r--test/tools/gold/X86/Inputs/thinlto_internalize.ll1
-rw-r--r--test/tools/gold/X86/Inputs/thinlto_linkonceresolution.ll1
-rw-r--r--test/tools/gold/X86/Inputs/thinlto_weak_resolution.ll1
-rw-r--r--test/tools/gold/X86/Inputs/type-merge.ll2
-rw-r--r--test/tools/gold/X86/Inputs/type-merge2.ll2
-rw-r--r--test/tools/gold/X86/Inputs/visibility.ll2
-rw-r--r--test/tools/gold/X86/Inputs/weak.ll2
-rw-r--r--test/tools/gold/X86/alias.ll2
-rw-r--r--test/tools/gold/X86/alias2.ll2
-rw-r--r--test/tools/gold/X86/available-externally.ll2
-rw-r--r--test/tools/gold/X86/bad-alias.ll2
-rw-r--r--test/tools/gold/X86/bcsection.ll1
-rw-r--r--test/tools/gold/X86/cache.ll1
-rw-r--r--test/tools/gold/X86/coff.ll2
-rw-r--r--test/tools/gold/X86/comdat.ll2
-rw-r--r--test/tools/gold/X86/comdat2.ll1
-rw-r--r--test/tools/gold/X86/common.ll2
-rw-r--r--test/tools/gold/X86/ctors.ll2
-rw-r--r--test/tools/gold/X86/ctors2.ll2
-rw-r--r--test/tools/gold/X86/disable-verify.ll1
-rw-r--r--test/tools/gold/X86/drop-linkage.ll2
-rw-r--r--test/tools/gold/X86/emit-llvm.ll1
-rw-r--r--test/tools/gold/X86/irmover-error.ll2
-rw-r--r--test/tools/gold/X86/linker-script.ll2
-rw-r--r--test/tools/gold/X86/linkonce-weak.ll2
-rw-r--r--test/tools/gold/X86/mixed_lto.ll1
-rw-r--r--test/tools/gold/X86/no-map-whole-file.ll3
-rw-r--r--test/tools/gold/X86/opt-level.ll3
-rw-r--r--test/tools/gold/X86/parallel.ll1
-rw-r--r--test/tools/gold/X86/pr19901.ll1
-rw-r--r--test/tools/gold/X86/pr19901_thinlto.ll1
-rw-r--r--test/tools/gold/X86/pr25907.ll2
-rw-r--r--test/tools/gold/X86/pr25915.ll2
-rw-r--r--test/tools/gold/X86/relax-relocs.ll1
-rw-r--r--test/tools/gold/X86/resolve-to-alias.ll2
-rw-r--r--test/tools/gold/X86/slp-vectorize.ll1
-rw-r--r--test/tools/gold/X86/start-lib-common.ll1
-rw-r--r--test/tools/gold/X86/strip_names.ll2
-rw-r--r--test/tools/gold/X86/thinlto.ll2
-rw-r--r--test/tools/gold/X86/thinlto_alias.ll1
-rw-r--r--test/tools/gold/X86/thinlto_archive.ll2
-rw-r--r--test/tools/gold/X86/thinlto_emit_imports.ll2
-rw-r--r--test/tools/gold/X86/thinlto_internalize.ll1
-rw-r--r--test/tools/gold/X86/thinlto_linkonceresolution.ll1
-rw-r--r--test/tools/gold/X86/thinlto_prefix_replace.ll2
-rw-r--r--test/tools/gold/X86/thinlto_weak_resolution.ll1
-rw-r--r--test/tools/gold/X86/type-merge.ll2
-rw-r--r--test/tools/gold/X86/type-merge2.ll2
-rw-r--r--test/tools/gold/X86/unnamed-addr.ll2
-rw-r--r--test/tools/gold/X86/visibility.ll2
-rw-r--r--test/tools/gold/X86/weak.ll2
-rw-r--r--test/tools/llvm-lto/Inputs/thinlto.ll2
-rw-r--r--test/tools/llvm-lto/thinlto.ll2
-rw-r--r--test/tools/llvm-lto2/X86/nodatalayout.ll13
-rw-r--r--test/tools/llvm-lto2/X86/pipeline.ll1
-rw-r--r--test/tools/llvm-lto2/errors.ll3
90 files changed, 162 insertions, 10 deletions
diff --git a/lib/LTO/LTO.cpp b/lib/LTO/LTO.cpp
index 718cbf17048..74de6c18aef 100644
--- a/lib/LTO/LTO.cpp
+++ b/lib/LTO/LTO.cpp
@@ -380,6 +380,11 @@ Error LTO::addModule(InputFile &Input, InputFile::InputModule &IM,
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())
diff --git a/lib/LTO/LTOBackend.cpp b/lib/LTO/LTOBackend.cpp
index 9d4cbdde3ff..87338260998 100644
--- a/lib/LTO/LTOBackend.cpp
+++ b/lib/LTO/LTOBackend.cpp
@@ -191,7 +191,6 @@ static void runOldPMPasses(Config &Conf, Module &Mod, TargetMachine *TM,
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
diff --git a/lib/LTO/LTOModule.cpp b/lib/LTO/LTOModule.cpp
index e61a10e5b9e..89aeb800003 100644
--- a/lib/LTO/LTOModule.cpp
+++ b/lib/LTO/LTOModule.cpp
@@ -233,7 +233,6 @@ LTOModule::makeLTOModule(MemoryBufferRef Buffer, const TargetOptions &options,
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();
diff --git a/test/LTO/Resolution/X86/Inputs/common2.ll b/test/LTO/Resolution/X86/Inputs/common2.ll
index 577e9977ac0..c3a7f753684 100644
--- a/test/LTO/Resolution/X86/Inputs/common2.ll
+++ b/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
+}
diff --git a/test/LTO/Resolution/X86/Inputs/mixed_lto.ll b/test/LTO/Resolution/X86/Inputs/mixed_lto.ll
index 44e82c9fac7..2393deb3241 100644
--- a/test/LTO/Resolution/X86/Inputs/mixed_lto.ll
+++ b/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() {
diff --git a/test/LTO/Resolution/X86/common2.ll b/test/LTO/Resolution/X86/common2.ll
index 4a6c95b7a14..3328d7c5ec3 100644
--- a/test/LTO/Resolution/X86/common2.ll
+++ b/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
diff --git a/test/LTO/Resolution/X86/mixed_lto.ll b/test/LTO/Resolution/X86/mixed_lto.ll
index 0302ed990e0..02b15c61154 100644
--- a/test/LTO/Resolution/X86/mixed_lto.ll
+++ b/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
diff --git a/test/LTO/X86/diagnostic-handler-remarks-with-hotness.ll b/test/LTO/X86/diagnostic-handler-remarks-with-hotness.ll
index 8a7f4c81b9e..e5d53c7774a 100644
--- a/test/LTO/X86/diagnostic-handler-remarks-with-hotness.ll
+++ b/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()
diff --git a/test/LTO/X86/diagnostic-handler-remarks.ll b/test/LTO/X86/diagnostic-handler-remarks.ll
index c9e6beb0ace..456bdb5419c 100644
--- a/test/LTO/X86/diagnostic-handler-remarks.ll
+++ b/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()
diff --git a/test/LTO/X86/no-undefined-puts-when-implemented.ll b/test/LTO/X86/no-undefined-puts-when-implemented.ll
index 132ec671d5b..51e5eabd03f 100644
--- a/test/LTO/X86/no-undefined-puts-when-implemented.ll
+++ b/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"
diff --git a/test/LTO/X86/triple-init.ll b/test/LTO/X86/triple-init.ll
index e0ad87967ba..7e45952b4e0 100644
--- a/test/LTO/X86/triple-init.ll
+++ b/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)
diff --git a/test/ThinLTO/X86/Inputs/distributed_import.ll b/test/ThinLTO/X86/Inputs/distributed_import.ll
index 759c3371434..818c1ff3f8e 100644
--- a/test/ThinLTO/X86/Inputs/distributed_import.ll
+++ b/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:
diff --git a/test/ThinLTO/X86/distributed_import.ll b/test/ThinLTO/X86/distributed_import.ll
index b1ffd51359d..0a3f9c07f25 100644
--- a/test/ThinLTO/X86/distributed_import.ll
+++ b/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() {
diff --git a/test/tools/gold/X86/Inputs/alias-1.ll b/test/tools/gold/X86/Inputs/alias-1.ll
index 96183aa9537..58d220ef2be 100644
--- a/test/tools/gold/X86/Inputs/alias-1.ll
+++ b/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
diff --git a/test/tools/gold/X86/Inputs/available-externally.ll b/test/tools/gold/X86/Inputs/available-externally.ll
index cbc5c12c65d..ae2a360d74a 100644
--- a/test/tools/gold/X86/Inputs/available-externally.ll
+++ b/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
}
diff --git a/test/tools/gold/X86/Inputs/cache.ll b/test/tools/gold/X86/Inputs/cache.ll
index 39fa05a23c6..4abbb457137 100644
--- a/test/tools/gold/X86/Inputs/cache.ll
+++ b/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() {
diff --git a/test/tools/gold/X86/Inputs/comdat.ll b/test/tools/gold/X86/Inputs/comdat.ll
index 734115180ff..e70b7181566 100644
--- a/test/tools/gold/X86/Inputs/comdat.ll
+++ b/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
diff --git a/test/tools/gold/X86/Inputs/comdat2.ll b/test/tools/gold/X86/Inputs/comdat2.ll
index 5b7f74cf0b2..20bc4bf023e 100644
--- a/test/tools/gold/X86/Inputs/comdat2.ll
+++ b/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() {
diff --git a/test/tools/gold/X86/Inputs/common.ll b/test/tools/gold/X86/Inputs/common.ll
index 48e03562370..8743e417144 100644
--- a/test/tools/gold/X86/Inputs/common.ll
+++ b/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
diff --git a/test/tools/gold/X86/Inputs/common2.ll b/test/tools/gold/X86/Inputs/common2.ll
index 0f309d88a00..a378063178f 100644
--- a/test/tools/gold/X86/Inputs/common2.ll
+++ b/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
diff --git a/test/tools/gold/X86/Inputs/common3.ll b/test/tools/gold/X86/Inputs/common3.ll
index 21d79730bdd..aba9dc80ee5 100644
--- a/test/tools/gold/X86/Inputs/common3.ll
+++ b/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
diff --git a/test/tools/gold/X86/Inputs/ctors2.ll b/test/tools/gold/X86/Inputs/ctors2.ll
index af1590eb277..c83ce43f117 100644
--- a/test/tools/gold/X86/Inputs/ctors2.ll
+++ b/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() {
diff --git a/test/tools/gold/X86/Inputs/drop-linkage.ll b/test/tools/gold/X86/Inputs/drop-linkage.ll
index 07530611433..0799e11d32d 100644
--- a/test/tools/gold/X86/Inputs/drop-linkage.ll
+++ b/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
diff --git a/test/tools/gold/X86/Inputs/irmover-error.ll b/test/tools/gold/X86/Inputs/irmover-error.ll
index 1ed82c284a7..a509a9548de 100644
--- a/test/tools/gold/X86/Inputs/irmover-error.ll
+++ b/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 }
diff --git a/test/tools/gold/X86/Inputs/linkonce-weak.ll b/test/tools/gold/X86/Inputs/linkonce-weak.ll
index db5185d72f2..1f480526e16 100644
--- a/test/tools/gold/X86/Inputs/linkonce-weak.ll
+++ b/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
}
diff --git a/test/tools/gold/X86/Inputs/mixed_lto.ll b/test/tools/gold/X86/Inputs/mixed_lto.ll
index 44e82c9fac7..2393deb3241 100644
--- a/test/tools/gold/X86/Inputs/mixed_lto.ll
+++ b/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() {
diff --git a/test/tools/gold/X86/Inputs/pr19901-1.ll b/test/tools/gold/X86/Inputs/pr19901-1.ll
index 2f7153268ac..45fa7384b5d 100644
--- a/test/tools/gold/X86/Inputs/pr19901-1.ll
+++ b/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
diff --git a/test/tools/gold/X86/Inputs/resolve-to-alias.ll b/test/tools/gold/X86/Inputs/resolve-to-alias.ll
index eff02a6f4d1..3097ef9f5b0 100644
--- a/test/tools/gold/X86/Inputs/resolve-to-alias.ll
+++ b/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
diff --git a/test/tools/gold/X86/Inputs/start-lib-common.ll b/test/tools/gold/X86/Inputs/start-lib-common.ll
index e8e53b8726d..9ba9e8e0843 100644
--- a/test/tools/gold/X86/Inputs/start-lib-common.ll
+++ b/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
diff --git a/test/tools/gold/X86/Inputs/thinlto.ll b/test/tools/gold/X86/Inputs/thinlto.ll
index 4e0840f3691..b81de922b4d 100644
--- a/test/tools/gold/X86/Inputs/thinlto.ll
+++ b/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
diff --git a/test/tools/gold/X86/Inputs/thinlto_alias.ll b/test/tools/gold/X86/Inputs/thinlto_alias.ll
index 4cee11dfc77..c9ef035080b 100644
--- a/test/tools/gold/X86/Inputs/thinlto_alias.ll
+++ b/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:
diff --git a/test/tools/gold/X86/Inputs/thinlto_archive1.ll b/test/tools/gold/X86/Inputs/thinlto_archive1.ll
index 4e0840f3691..b81de922b4d 100644
--- a/test/tools/gold/X86/Inputs/thinlto_archive1.ll
+++ b/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
diff --git a/test/tools/gold/X86/Inputs/thinlto_archive2.ll b/test/tools/gold/X86/Inputs/thinlto_archive2.ll
index a95d912ea5c..c2bda1712a4 100644
--- a/test/tools/gold/X86/Inputs/thinlto_archive2.ll
+++ b/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
diff --git a/test/tools/gold/X86/Inputs/thinlto_empty.ll b/test/tools/gold/X86/Inputs/thinlto_empty.ll
index e69de29bb2d..70bb58e5eeb 100644
--- a/test/tools/gold/X86/Inputs/thinlto_empty.ll
+++ b/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"
diff --git a/test/tools/gold/X86/Inputs/thinlto_internalize.ll b/test/tools/gold/X86/Inputs/thinlto_internalize.ll
index 44e82c9fac7..2393deb3241 100644
--- a/test/tools/gold/X86/Inputs/thinlto_internalize.ll
+++ b/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() {
diff --git a/test/tools/gold/X86/Inputs/thinlto_linkonceresolution.ll b/test/tools/gold/X86/Inputs/thinlto_linkonceresolution.ll
index 2f7153268ac..45fa7384b5d 100644
--- a/test/tools/gold/X86/Inputs/thinlto_linkonceresolution.ll
+++ b/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
diff --git a/test/tools/gold/X86/Inputs/thinlto_weak_resolution.ll b/test/tools/gold/X86/Inputs/thinlto_weak_resolution.ll
index 86e2ce357b8..0f817d7db3a 100644
--- a/test/tools/gold/X86/Inputs/thinlto_weak_resolution.ll
+++ b/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
diff --git a/test/tools/gold/X86/Inputs/type-merge.ll b/test/tools/gold/X86/Inputs/type-merge.ll
index 4dc214922dc..6e94bc08d41 100644
--- a/test/tools/gold/X86/Inputs/type-merge.ll
+++ b/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
diff --git a/test/tools/gold/X86/Inputs/type-merge2.ll b/test/tools/gold/X86/Inputs/type-merge2.ll
index a354757ee2e..7cdea6e82f3 100644
--- a/test/tools/gold/X86/Inputs/type-merge2.ll
+++ b/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
diff --git a/test/tools/gold/X86/Inputs/visibility.ll b/test/tools/gold/X86/Inputs/visibility.ll
index b758d4a0c08..42796a97bc8 100644
--- a/test/tools/gold/X86/Inputs/visibility.ll
+++ b/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
}
diff --git a/test/tools/gold/X86/Inputs/weak.ll b/test/tools/gold/X86/Inputs/weak.ll
index 53b1d1650d1..5209d343f23 100644
--- a/test/tools/gold/X86/Inputs/weak.ll
+++ b/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
diff --git a/test/tools/gold/X86/alias.ll b/test/tools/gold/X86/alias.ll
index c659f73d7e8..98333422303 100644
--- a/test/tools/gold/X86/alias.ll
+++ b/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
diff --git a/test/tools/gold/X86/alias2.ll b/test/tools/gold/X86/alias2.ll
index 4727e0508fa..3beecd4190d 100644
--- a/test/tools/gold/X86/alias2.ll
+++ b/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()
diff --git a/test/tools/gold/X86/available-externally.ll b/test/tools/gold/X86/available-externally.ll
index d47a536dc09..f01f45de21f 100644
--- a/test/tools/gold/X86/available-externally.ll
+++ b/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()
diff --git a/test/tools/gold/X86/bad-alias.ll b/test/tools/gold/X86/bad-alias.ll
index c4e3c3fe82f..2a09f69c6e1 100644
--- a/test/tools/gold/X86/bad-alias.ll
+++ b/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
diff --git a/test/tools/gold/X86/bcsection.ll b/test/tools/gold/X86/bcsection.ll
index f7ebe375770..8d1598751d8 100644
--- a/test/tools/gold/X86/bcsection.ll
+++ b/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
diff --git a/test/tools/gold/X86/cache.ll b/test/tools/gold/X86/cache.ll
index 756710e482b..cef983c4a1a 100644
--- a/test/tools/gold/X86/cache.ll
+++ b/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 {
diff --git a/test/tools/gold/X86/coff.ll b/test/tools/gold/X86/coff.ll
index 70d4f916159..541383ddf51 100644
--- a/test/tools/gold/X86/coff.ll
+++ b/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() {
diff --git a/test/tools/gold/X86/comdat.ll b/test/tools/gold/X86/comdat.ll
index 2170bf89d0c..8ed520c17c0 100644
--- a/test/tools/gold/X86/comdat.ll
+++ b/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)
diff --git a/test/tools/gold/X86/comdat2.ll b/test/tools/gold/X86/comdat2.ll
index 2156efd207b..a15ae1daf5a 100644
--- a/test/tools/gold/X86/comdat2.ll
+++ b/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
diff --git a/test/tools/gold/X86/common.ll b/test/tools/gold/X86/common.ll
index 25a889f8fd6..ca506f6dd2d 100644
--- a/test/tools/gold/X86/common.ll
+++ b/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 \
diff --git a/test/tools/gold/X86/ctors.ll b/test/tools/gold/X86/ctors.ll
index 24c8e342beb..068a503a105 100644
--- a/test/tools/gold/X86/ctors.ll
+++ b/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() {
diff --git a/test/tools/gold/X86/ctors2.ll b/test/tools/gold/X86/ctors2.ll
index c39cb7132d9..07802c0a5c1 100644
--- a/test/tools/gold/X86/ctors2.ll
+++ b/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() {
diff --git a/test/tools/gold/X86/disable-verify.ll b/test/tools/gold/X86/disable-verify.ll
index af64061704b..6463504630f 100644
--- a/test/tools/gold/X86/disable-verify.ll
+++ b/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
diff --git a/test/tools/gold/X86/drop-linkage.ll b/test/tools/gold/X86/drop-linkage.ll
index 3013c247aa6..c85d28e15cc 100644
--- a/test/tools/gold/X86/drop-linkage.ll
+++ b/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
}
diff --git a/test/tools/gold/X86/emit-llvm.ll b/test/tools/gold/X86/emit-llvm.ll
index ec1ea8f3673..70d244c34ec 100644
--- a/test/tools/gold/X86/emit-llvm.ll
+++ b/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
diff --git a/test/tools/gold/X86/irmover-error.ll b/test/tools/gold/X86/irmover-error.ll
index 2bfbaf4e8af..32f4b018bf6 100644
--- a/test/tools/gold/X86/irmover-error.ll
+++ b/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 }
diff --git a/test/tools/gold/X86/linker-script.ll b/test/tools/gold/X86/linker-script.ll
index 7c88b0ffd5f..3cc067550a6 100644
--- a/test/tools/gold/X86/linker-script.ll
+++ b/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
diff --git a/test/tools/gold/X86/linkonce-weak.ll b/test/tools/gold/X86/linkonce-weak.ll
index fa6372cda81..258c8dc1fa7 100644
--- a/test/tools/gold/X86/linkonce-weak.ll
+++ b/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
}
diff --git a/test/tools/gold/X86/mixed_lto.ll b/test/tools/gold/X86/mixed_lto.ll
index c7085940203..4b53ff9ec38 100644
--- a/test/tools/gold/X86/mixed_lto.ll
+++ b/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
diff --git a/test/tools/gold/X86/no-map-whole-file.ll b/test/tools/gold/X86/no-map-whole-file.ll
index 4c261d70a24..eb74bd78fc9 100644
--- a/test/tools/gold/X86/no-map-whole-file.ll
+++ b/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
}
diff --git a/test/tools/gold/X86/opt-level.ll b/test/tools/gold/X86/opt-level.ll
index 66935b478cf..d072866f7db 100644
--- a/test/tools/gold/X86/opt-level.ll
+++ b/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
}
diff --git a/test/tools/gold/X86/parallel.ll b/test/tools/gold/X86/parallel.ll
index e1923ae73f8..52232918c80 100644
--- a/test/tools/gold/X86/parallel.ll
+++ b/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
diff --git a/test/tools/gold/X86/pr19901.ll b/test/tools/gold/X86/pr19901.ll
index d1b1076b6ea..7967f6cc42a 100644
--- a/test/tools/gold/X86/pr19901.ll
+++ b/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()
diff --git a/test/tools/gold/X86/pr19901_thinlto.ll b/test/tools/gold/X86/pr19901_thinlto.ll
index f2532902577..6a9dd2432fd 100644
--- a/test/tools/gold/X86/pr19901_thinlto.ll
+++ b/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()
diff --git a/test/tools/gold/X86/pr25907.ll b/test/tools/gold/X86/pr25907.ll
index 502938cf812..f33f2f24245 100644
--- a/test/tools/gold/X86/pr25907.ll
+++ b/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 {
diff --git a/test/tools/gold/X86/pr25915.ll b/test/tools/gold/X86/pr25915.ll
index e94283072b1..20e4b8b4882 100644
--- a/test/tools/gold/X86/pr25915.ll
+++ b/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}
diff --git a/test/tools/gold/X86/relax-relocs.ll b/test/tools/gold/X86/relax-relocs.ll
index 13a813fad08..72f081e81c3 100644
--- a/test/tools/gold/X86/relax-relocs.ll
+++ b/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
diff --git a/test/tools/gold/X86/resolve-to-alias.ll b/test/tools/gold/X86/resolve-to-alias.ll
index 102da6f80f4..bf4a33fcb33 100644
--- a/test/tools/gold/X86/resolve-to-alias.ll
+++ b/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
diff --git a/test/tools/gold/X86/slp-vectorize.ll b/test/tools/gold/X86/slp-vectorize.ll
index e63a21cbb53..7ce4b8ecec7 100644
--- a/test/tools/gold/X86/slp-vectorize.ll
+++ b/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) {
diff --git a/test/tools/gold/X86/start-lib-common.ll b/test/tools/gold/X86/start-lib-common.ll
index f4de62ec99b..085cfbd903f 100644
--- a/test/tools/gold/X86/start-lib-common.ll
+++ b/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
diff --git a/test/tools/gold/X86/strip_names.ll b/test/tools/gold/X86/strip_names.ll
index 2664a82fbd1..bb974c8aebe 100644
--- a/test/tools/gold/X86/strip_names.ll
+++ b/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) {
diff --git a/test/tools/gold/X86/thinlto.ll b/test/tools/gold/X86/thinlto.ll
index adc52bd0e10..9ce070a6b5e 100644
--- a/test/tools/gold/X86/thinlto.ll
+++ b/test/tools/gold/X86/thinlto.ll
@@ -115,6 +115,8 @@
; 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() {
diff --git a/test/tools/gold/X86/thinlto_alias.ll b/test/tools/gold/X86/thinlto_alias.ll
index 33c888daf17..97d4f7c3997 100644
--- a/test/tools/gold/X86/thinlto_alias.ll
+++ b/test/tools/gold/X86/thinlto_alias.ll
@@ -27,6 +27,7 @@
; 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 (...)*)
diff --git a/test/tools/gold/X86/thinlto_archive.ll b/test/tools/gold/X86/thinlto_archive.ll
index d3f0fceb163..c2ae679dfb0 100644
--- a/test/tools/gold/X86/thinlto_archive.ll
+++ b/test/tools/gold/X86/thinlto_archive.ll
@@ -15,6 +15,8 @@
; 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
diff --git a/test/tools/gold/X86/thinlto_emit_imports.ll b/test/tools/gold/X86/thinlto_emit_imports.ll
index 4346ece7ce2..ebe90fe7a99 100644
--- a/test/tools/gold/X86/thinlto_emit_imports.ll
+++ b/test/tools/gold/X86/thinlto_emit_imports.ll
@@ -28,6 +28,8 @@
; 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() {
diff --git a/test/tools/gold/X86/thinlto_internalize.ll b/test/tools/gold/X86/thinlto_internalize.ll
index 8d0033c1f98..f8b200e3197 100644
--- a/test/tools/gold/X86/thinlto_internalize.ll
+++ b/test/tools/gold/X86/thinlto_internalize.ll
@@ -14,6 +14,7 @@
; 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()
diff --git a/test/tools/gold/X86/thinlto_linkonceresolution.ll b/test/tools/gold/X86/thinlto_linkonceresolution.ll
index 810b2dd7b2d..bf2d22a9ef7 100644
--- a/test/tools/gold/X86/thinlto_linkonceresolution.ll
+++ b/test/tools/gold/X86/thinlto_linkonceresolution.ll
@@ -23,6 +23,7 @@
; 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()
diff --git a/test/tools/gold/X86/thinlto_prefix_replace.ll b/test/tools/gold/X86/thinlto_prefix_replace.ll
index a635088a460..200f331b685 100644
--- a/test/tools/gold/X86/thinlto_prefix_replace.ll
+++ b/test/tools/gold/X86/thinlto_prefix_replace.ll
@@ -11,6 +11,8 @@
; 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
diff --git a/test/tools/gold/X86/thinlto_weak_resolution.ll b/test/tools/gold/X86/thinlto_weak_resolution.ll
index 095f8aded81..8215c42f10c 100644
--- a/test/tools/gold/X86/thinlto_weak_resolution.ll
+++ b/test/tools/gold/X86/thinlto_weak_resolution.ll
@@ -26,6 +26,7 @@
; 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"
diff --git a/test/tools/gold/X86/type-merge.ll b/test/tools/gold/X86/type-merge.ll
index d903894345d..b79e977b3ac 100644
--- a/test/tools/gold/X86/type-merge.ll
+++ b/test/tools/gold/X86/type-merge.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"
+
define void @foo() {
call void @bar(i8* null)
ret void
diff --git a/test/tools/gold/X86/type-merge2.ll b/test/tools/gold/X86/type-merge2.ll
index 6a1002f06f4..d020336ca7f 100644
--- a/test/tools/gold/X86/type-merge2.ll
+++ b/test/tools/gold/X86/type-merge2.ll
@@ -5,6 +5,8 @@
; 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)
diff --git a/test/tools/gold/X86/unnamed-addr.ll b/test/tools/gold/X86/unnamed-addr.ll
index 290f73d8548..92f8e7a2abc 100644
--- a/test/tools/gold/X86/unnamed-addr.ll
+++ b/test/tools/gold/X86/unnamed-addr.ll
@@ -5,6 +5,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"
+
@a = internal unnamed_addr constant i8 42
define i8* @f() {
diff --git a/test/tools/gold/X86/visibility.ll b/test/tools/gold/X86/visibility.ll
index 747a0c3a59e..f63bdbd2c95 100644
--- a/test/tools/gold/X86/visibility.ll
+++ b/test/tools/gold/X86/visibility.ll
@@ -18,6 +18,8 @@
; 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
}
diff --git a/test/tools/gold/X86/weak.ll b/test/tools/gold/X86/weak.ll
index 6d8d7a871f1..35cdbbb1427 100644
--- a/test/tools/gold/X86/weak.ll
+++ b/test/tools/gold/X86/weak.ll
@@ -6,6 +6,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"
+
@a = weak global i32 42
@b = global i32* @a
diff --git a/test/tools/llvm-lto/Inputs/thinlto.ll b/test/tools/llvm-lto/Inputs/thinlto.ll
index 4e0840f3691..b81de922b4d 100644
--- a/test/tools/llvm-lto/Inputs/thinlto.ll
+++ b/test/tools/llvm-lto/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
diff --git a/test/tools/llvm-lto/thinlto.ll b/test/tools/llvm-lto/thinlto.ll
index 38c4196bb25..61c52b33e72 100644
--- a/test/tools/llvm-lto/thinlto.ll
+++ b/test/tools/llvm-lto/thinlto.ll
@@ -21,6 +21,8 @@
; 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
diff --git a/test/tools/llvm-lto2/X86/nodatalayout.ll b/test/tools/llvm-lto2/X86/nodatalayout.ll
new file mode 100644
index 00000000000..ee5cfb0e470
--- /dev/null
+++ b/test/tools/llvm-lto2/X86/nodatalayout.ll
@@ -0,0 +1,13 @@
+; 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
+}
diff --git a/test/tools/llvm-lto2/X86/pipeline.ll b/test/tools/llvm-lto2/X86/pipeline.ll
index 69c1b8b1063..d08659db3af 100644
--- a/test/tools/llvm-lto2/X86/pipeline.ll
+++ b/test/tools/llvm-lto2/X86/pipeline.ll
@@ -6,6 +6,7 @@
; 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() {
diff --git a/test/tools/llvm-lto2/errors.ll b/test/tools/llvm-lto2/errors.ll
index cd2394dc012..25c05430c93 100644
--- a/test/tools/llvm-lto2/errors.ll
+++ b/test/tools/llvm-lto2/errors.ll
@@ -8,4 +8,7 @@
; 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