summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Bitcode/Inputs/module_hash.ll2
-rw-r--r--llvm/test/Bitcode/module_hash.ll1
-rw-r--r--llvm/test/ThinLTO/X86/Inputs/alias_import.ll4
-rw-r--r--llvm/test/ThinLTO/X86/Inputs/alias_resolution.ll4
-rw-r--r--llvm/test/ThinLTO/X86/Inputs/distributed_indexes.ll2
-rw-r--r--llvm/test/ThinLTO/X86/Inputs/merge-triple.ll1
-rw-r--r--llvm/test/ThinLTO/X86/Inputs/section.ll1
-rw-r--r--llvm/test/ThinLTO/X86/Inputs/thinlto-internalize-used2.ll10
-rw-r--r--llvm/test/ThinLTO/X86/alias_import.ll2
-rw-r--r--llvm/test/ThinLTO/X86/alias_resolution.ll1
-rw-r--r--llvm/test/ThinLTO/X86/deadstrip.ll4
-rw-r--r--llvm/test/ThinLTO/X86/distributed_indexes.ll2
-rw-r--r--llvm/test/ThinLTO/X86/internalize.ll2
-rw-r--r--llvm/test/ThinLTO/X86/linkonce_odr_unnamed_addr.ll2
-rw-r--r--llvm/test/ThinLTO/X86/merge-triple.ll1
-rw-r--r--llvm/test/ThinLTO/X86/prefix_replace.ll1
-rw-r--r--llvm/test/ThinLTO/X86/section.ll1
-rw-r--r--llvm/test/ThinLTO/X86/thinlto-internalize-used.ll21
-rw-r--r--llvm/test/ThinLTO/X86/weak_resolution.ll2
-rw-r--r--llvm/test/ThinLTO/X86/weak_resolution_single.ll3
-rw-r--r--llvm/test/Transforms/ThinLTOBitcodeWriter/no-type-md.ll2
21 files changed, 58 insertions, 11 deletions
diff --git a/llvm/test/Bitcode/Inputs/module_hash.ll b/llvm/test/Bitcode/Inputs/module_hash.ll
index 1d422c6e817..367b4d00ab0 100644
--- a/llvm/test/Bitcode/Inputs/module_hash.ll
+++ b/llvm/test/Bitcode/Inputs/module_hash.ll
@@ -1,4 +1,6 @@
; Needs a function for the combined index to be populated
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
+
define void @bar() {
ret void
}
diff --git a/llvm/test/Bitcode/module_hash.ll b/llvm/test/Bitcode/module_hash.ll
index b24819fe6fd..62a121def19 100644
--- a/llvm/test/Bitcode/module_hash.ll
+++ b/llvm/test/Bitcode/module_hash.ll
@@ -28,6 +28,7 @@
; COMBINED-DAG: <HASH abbrevid={{[0-9]*}} op0=[[HASH1_1]] op1=[[HASH1_2]] op2=[[HASH1_3]] op3=[[HASH1_4]] op4=[[HASH1_5]]/>
; COMBINED-DAG: <HASH abbrevid={{[0-9]*}} op0=[[HASH2_1]] op1=[[HASH2_2]] op2=[[HASH2_3]] op3=[[HASH2_4]] op4=[[HASH2_5]]/>
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
; Need a function for the combined index to be populated.
define void @foo() {
diff --git a/llvm/test/ThinLTO/X86/Inputs/alias_import.ll b/llvm/test/ThinLTO/X86/Inputs/alias_import.ll
index 36e5ad1e91e..7425f23fd3f 100644
--- a/llvm/test/ThinLTO/X86/Inputs/alias_import.ll
+++ b/llvm/test/ThinLTO/X86/Inputs/alias_import.ll
@@ -1,6 +1,4 @@
-
-
-
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
@globalfuncAlias = alias void (...), bitcast (void ()* @globalfunc to void (...)*)
@globalfuncWeakAlias = weak alias void (...), bitcast (void ()* @globalfunc to void (...)*)
diff --git a/llvm/test/ThinLTO/X86/Inputs/alias_resolution.ll b/llvm/test/ThinLTO/X86/Inputs/alias_resolution.ll
index 36e5ad1e91e..7425f23fd3f 100644
--- a/llvm/test/ThinLTO/X86/Inputs/alias_resolution.ll
+++ b/llvm/test/ThinLTO/X86/Inputs/alias_resolution.ll
@@ -1,6 +1,4 @@
-
-
-
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
@globalfuncAlias = alias void (...), bitcast (void ()* @globalfunc to void (...)*)
@globalfuncWeakAlias = weak alias void (...), bitcast (void ()* @globalfunc to void (...)*)
diff --git a/llvm/test/ThinLTO/X86/Inputs/distributed_indexes.ll b/llvm/test/ThinLTO/X86/Inputs/distributed_indexes.ll
index 2755d264b3e..65c3bb61164 100644
--- a/llvm/test/ThinLTO/X86/Inputs/distributed_indexes.ll
+++ b/llvm/test/ThinLTO/X86/Inputs/distributed_indexes.ll
@@ -1,3 +1,5 @@
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
+
define void @g() {
entry:
ret void
diff --git a/llvm/test/ThinLTO/X86/Inputs/merge-triple.ll b/llvm/test/ThinLTO/X86/Inputs/merge-triple.ll
index ea644f5497b..6ee881573ce 100644
--- a/llvm/test/ThinLTO/X86/Inputs/merge-triple.ll
+++ b/llvm/test/ThinLTO/X86/Inputs/merge-triple.ll
@@ -1 +1,2 @@
target triple = "x86_64-apple-macosx10.11.0"
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
diff --git a/llvm/test/ThinLTO/X86/Inputs/section.ll b/llvm/test/ThinLTO/X86/Inputs/section.ll
index 4f4ea91c986..a1e969a3d6c 100644
--- a/llvm/test/ThinLTO/X86/Inputs/section.ll
+++ b/llvm/test/ThinLTO/X86/Inputs/section.ll
@@ -1,4 +1,5 @@
; An internal global variable that can't be renamed because it has a section
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
@var_with_section = internal global i32 0, section "some_section"
; @reference_gv_with_section() can't be imported
diff --git a/llvm/test/ThinLTO/X86/Inputs/thinlto-internalize-used2.ll b/llvm/test/ThinLTO/X86/Inputs/thinlto-internalize-used2.ll
new file mode 100644
index 00000000000..225685d931b
--- /dev/null
+++ b/llvm/test/ThinLTO/X86/Inputs/thinlto-internalize-used2.ll
@@ -0,0 +1,10 @@
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-apple-macosx10.15.0"
+
+define i32 @main() {
+entry:
+ %call = call i32 @bar()
+ ret i32 0
+}
+
+declare i32 @bar()
diff --git a/llvm/test/ThinLTO/X86/alias_import.ll b/llvm/test/ThinLTO/X86/alias_import.ll
index d54e74e7b11..af131e145bb 100644
--- a/llvm/test/ThinLTO/X86/alias_import.ll
+++ b/llvm/test/ThinLTO/X86/alias_import.ll
@@ -83,6 +83,8 @@
; IMPORT-DAG: declare void @linkonceODRfuncLinkonceAlias()
; IMPORT-DAG: define available_externally void @linkonceODRfuncLinkonceODRAlias()
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
+
define i32 @main() #0 {
entry:
call void @globalfuncAlias()
diff --git a/llvm/test/ThinLTO/X86/alias_resolution.ll b/llvm/test/ThinLTO/X86/alias_resolution.ll
index bdf3f3a35bd..4649a889918 100644
--- a/llvm/test/ThinLTO/X86/alias_resolution.ll
+++ b/llvm/test/ThinLTO/X86/alias_resolution.ll
@@ -43,6 +43,7 @@
; PROMOTE_MOD1: @weakfuncLinkonceODRAlias = weak_odr alias void (...), bitcast (void ()* @weakfunc.mod1 to void (...)*)
; PROMOTE_MOD2: @weakfuncLinkonceODRAlias = linkonce_odr alias void (...), bitcast (void ()* @weakfunc to void (...)*)
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
@linkonceODRfuncAlias = alias void (...), bitcast (void ()* @linkonceODRfunc.mod1 to void (...)*)
@linkonceODRfuncWeakAlias = weak alias void (...), bitcast (void ()* @linkonceODRfunc.mod1 to void (...)*)
diff --git a/llvm/test/ThinLTO/X86/deadstrip.ll b/llvm/test/ThinLTO/X86/deadstrip.ll
index 257cfafb767..bcce9376849 100644
--- a/llvm/test/ThinLTO/X86/deadstrip.ll
+++ b/llvm/test/ThinLTO/X86/deadstrip.ll
@@ -5,8 +5,8 @@
; RUN: opt -module-summary %p/Inputs/deadstrip.ll -o %t2.bc
; RUN: llvm-lto -thinlto-action=thinlink -o %t.index.bc %t1.bc %t2.bc
-; RUN: llvm-lto -exported-symbol=_main -thinlto-action=promote %t1.bc -thinlto-index=%t.index.bc -o - | llvm-lto -exported-symbol=_main -thinlto-action=internalize -thinlto-index %t.index.bc -thinlto-module-id=%t1.bc - -o - | llvm-dis -o - | FileCheck %s
-; RUN: llvm-lto -exported-symbol=_main -thinlto-action=promote %t2.bc -thinlto-index=%t.index.bc -o - | llvm-lto -exported-symbol=_main -thinlto-action=internalize -thinlto-index %t.index.bc -thinlto-module-id=%t2.bc - -o - | llvm-dis -o - | FileCheck %s --check-prefix=CHECK2
+; RUN: llvm-lto -exported-symbol=_main -thinlto-action=internalize %t1.bc -thinlto-index=%t.index.bc -o - | llvm-dis -o - | FileCheck %s
+; RUN: llvm-lto -exported-symbol=_main -thinlto-action=internalize %t2.bc -thinlto-index=%t.index.bc -o - | llvm-dis -o - | FileCheck %s --check-prefix=CHECK2
; RUN: llvm-lto -exported-symbol=_main -thinlto-action=run -stats %t1.bc %t2.bc 2>&1 | FileCheck %s --check-prefix=STATS
; RUN: llvm-nm %t1.bc.thinlto.o | FileCheck %s --check-prefix=CHECK-NM
diff --git a/llvm/test/ThinLTO/X86/distributed_indexes.ll b/llvm/test/ThinLTO/X86/distributed_indexes.ll
index 371f38f5074..228744f6384 100644
--- a/llvm/test/ThinLTO/X86/distributed_indexes.ll
+++ b/llvm/test/ThinLTO/X86/distributed_indexes.ll
@@ -46,6 +46,8 @@
; RUN: llvm-dis %t1.bc.thinlto.bc -o - | FileCheck %s --check-prefix=DIS
; DIS: aliasee: null
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
+
declare void @g(...)
declare void @analias(...)
diff --git a/llvm/test/ThinLTO/X86/internalize.ll b/llvm/test/ThinLTO/X86/internalize.ll
index 70b28469b48..49cab144b56 100644
--- a/llvm/test/ThinLTO/X86/internalize.ll
+++ b/llvm/test/ThinLTO/X86/internalize.ll
@@ -33,7 +33,7 @@
; INTERNALIZE: define internal void @linkonce_func()
; INTERNALIZE-OPTION-DISABLE: define void @foo
; INTERNALIZE-OPTION-DISABLE: define void @bar
-; INTERNALIZE-OPTION-DISABLE: define linkonce void @linkonce_func()
+; INTERNALIZE-OPTION-DISABLE: define weak void @linkonce_func()
; INTERNALIZE2: define dso_local void @foo
; INTERNALIZE2: define internal void @bar
; INTERNALIZE2: define internal void @linkonce_func()
diff --git a/llvm/test/ThinLTO/X86/linkonce_odr_unnamed_addr.ll b/llvm/test/ThinLTO/X86/linkonce_odr_unnamed_addr.ll
index 84bea3cbb9d..d5e8f5edeef 100644
--- a/llvm/test/ThinLTO/X86/linkonce_odr_unnamed_addr.ll
+++ b/llvm/test/ThinLTO/X86/linkonce_odr_unnamed_addr.ll
@@ -6,5 +6,7 @@
; RUN: llvm-lto -thinlto-action=thinlink -o %t3.bc %t.bc %t2.bc
; RUN: llvm-lto -thinlto-action=promote %t.bc -thinlto-index=%t3.bc -o - | llvm-dis -o - | FileCheck %s
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
+
; CHECK: @linkonceodrunnamed = weak_odr hidden unnamed_addr constant i32 0
@linkonceodrunnamed = linkonce_odr unnamed_addr constant i32 0
diff --git a/llvm/test/ThinLTO/X86/merge-triple.ll b/llvm/test/ThinLTO/X86/merge-triple.ll
index 8f099d12a23..11ab50236fe 100644
--- a/llvm/test/ThinLTO/X86/merge-triple.ll
+++ b/llvm/test/ThinLTO/X86/merge-triple.ll
@@ -4,6 +4,7 @@
; RUN: llvm-dis < %t1.bc.thinlto.imported.bc | FileCheck %s --check-prefix=CHECK1
; RUN: llvm-dis < %t2.bc.thinlto.imported.bc | FileCheck %s --check-prefix=CHECK2
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.12.0"
; CHECK1: target triple = "x86_64-apple-macosx10.12.0"
diff --git a/llvm/test/ThinLTO/X86/prefix_replace.ll b/llvm/test/ThinLTO/X86/prefix_replace.ll
index 5616f6260b9..c811762d347 100644
--- a/llvm/test/ThinLTO/X86/prefix_replace.ll
+++ b/llvm/test/ThinLTO/X86/prefix_replace.ll
@@ -10,6 +10,7 @@
; RUN: llvm-lto -thinlto-action=distributedindexes -thinlto-prefix-replace="%t/oldpath/;%t/newpath/" -thinlto-index %t.index.bc %t/oldpath/prefix_replace.o
; RUN: ls %t/newpath/prefix_replace.o.thinlto.bc
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
define void @f() {
entry:
diff --git a/llvm/test/ThinLTO/X86/section.ll b/llvm/test/ThinLTO/X86/section.ll
index 3cc1325e472..e44853aa731 100644
--- a/llvm/test/ThinLTO/X86/section.ll
+++ b/llvm/test/ThinLTO/X86/section.ll
@@ -12,6 +12,7 @@
; IMPORT: declare void @reference_gv_with_section()
; Canary to check that importing is correctly set up.
; IMPORT: define available_externally void @foo()
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
define i32 @main() {
diff --git a/llvm/test/ThinLTO/X86/thinlto-internalize-used.ll b/llvm/test/ThinLTO/X86/thinlto-internalize-used.ll
new file mode 100644
index 00000000000..065f64ec09a
--- /dev/null
+++ b/llvm/test/ThinLTO/X86/thinlto-internalize-used.ll
@@ -0,0 +1,21 @@
+; RUN: opt -module-summary -o %t.bc %s
+; RUN: opt -module-summary -o %t-main.bc %S/Inputs/thinlto-internalize-used2.ll
+; RUN: llvm-lto -thinlto-action=thinlink %t.bc %t-main.bc -o %t-index.bc
+; RUN: llvm-lto -thinlto-action=internalize -thinlto-index %t-index.bc %t.bc -o %t.promote.bc
+; RUN: llvm-dis %t.promote.bc -o - | FileCheck %s
+
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-apple-macosx10.15.0"
+
+@llvm.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @foo to i8*)], section "llvm.metadata"
+
+; Make sure foo is not internalized.
+; CHECK: define i32 @foo()
+define i32 @foo() {
+ ret i32 0
+}
+
+define hidden i32 @bar() {
+ ret i32 0
+}
+
diff --git a/llvm/test/ThinLTO/X86/weak_resolution.ll b/llvm/test/ThinLTO/X86/weak_resolution.ll
index 612cd6c206b..e39e4228529 100644
--- a/llvm/test/ThinLTO/X86/weak_resolution.ll
+++ b/llvm/test/ThinLTO/X86/weak_resolution.ll
@@ -7,7 +7,7 @@
; non-prevailing ODR are not kept when possible, but non-ODR non-prevailing
; are not affected.
; RUN: llvm-lto -thinlto-action=promote %t.bc -thinlto-index=%t3.bc -o - | llvm-dis -o - | FileCheck %s --check-prefix=MOD1
-; RUN: llvm-lto -thinlto-action=promote %t.bc -thinlto-index=%t3.bc -exported-symbol=linkoncefunc -o - | llvm-lto -thinlto-action=internalize -thinlto-module-id=%t.bc - -thinlto-index=%t3.bc -exported-symbol=linkoncefunc -o - | llvm-dis -o - | FileCheck %s --check-prefix=MOD1-INT
+; RUN: llvm-lto -thinlto-action=internalize %t.bc -thinlto-index=%t3.bc -exported-symbol=linkoncefunc -o - | llvm-dis -o - | FileCheck %s --check-prefix=MOD1-INT
; RUN: llvm-lto -thinlto-action=promote %t2.bc -thinlto-index=%t3.bc -o - | llvm-dis -o - | FileCheck %s --check-prefix=MOD2
; When exported, we always preserve a linkonce
; RUN: llvm-lto -thinlto-action=promote %t.bc -thinlto-index=%t3.bc -o - --exported-symbol=linkonceodrfuncInSingleModule | llvm-dis -o - | FileCheck %s --check-prefix=EXPORTED
diff --git a/llvm/test/ThinLTO/X86/weak_resolution_single.ll b/llvm/test/ThinLTO/X86/weak_resolution_single.ll
index 79bf5f39322..779b967ab89 100644
--- a/llvm/test/ThinLTO/X86/weak_resolution_single.ll
+++ b/llvm/test/ThinLTO/X86/weak_resolution_single.ll
@@ -1,9 +1,10 @@
; RUN: opt -module-summary %s -o %t.bc
; RUN: llvm-lto -thinlto-action=thinlink -o %t2.bc %t.bc
-; RUN: llvm-lto -thinlto-action=promote %t.bc -thinlto-index=%t2.bc -exported-symbol=foo -o - | llvm-lto -thinlto-action=internalize -thinlto-module-id=%t.bc - -thinlto-index=%t2.bc -exported-symbol=foo -o - | llvm-dis -o - | FileCheck %s
+; RUN: llvm-lto -thinlto-action=internalize %t.bc -thinlto-index=%t2.bc -exported-symbol=foo -o - | llvm-dis -o - | FileCheck %s
; CHECK: define weak_odr void @foo()
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
define linkonce_odr void @foo() {
ret void
}
diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/no-type-md.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/no-type-md.ll
index 9b78ed8021c..fe7ef4671b4 100644
--- a/llvm/test/Transforms/ThinLTOBitcodeWriter/no-type-md.ll
+++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/no-type-md.ll
@@ -27,6 +27,8 @@
; BCA: <GLOBALVAL_SUMMARY_BLOCK
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
+
; CHECK: @g = global i8 42
@g = global i8 42
OpenPOWER on IntegriCloud