diff options
Diffstat (limited to 'test/ThinLTO/X86')
-rw-r--r-- | test/ThinLTO/X86/deadstrip.ll | 30 | ||||
-rw-r--r-- | test/ThinLTO/X86/funcimport2.ll | 4 | ||||
-rw-r--r-- | test/ThinLTO/X86/internalize.ll | 9 | ||||
-rw-r--r-- | test/ThinLTO/X86/lazyload_metadata.ll | 4 | ||||
-rw-r--r-- | test/ThinLTO/X86/reference_non_importable.ll | 2 |
5 files changed, 30 insertions, 19 deletions
diff --git a/test/ThinLTO/X86/deadstrip.ll b/test/ThinLTO/X86/deadstrip.ll index c19ccb01be3..90de3bb9a32 100644 --- a/test/ThinLTO/X86/deadstrip.ll +++ b/test/ThinLTO/X86/deadstrip.ll @@ -18,8 +18,8 @@ ; RUN: -r %t2.bc,_boo,pl \ ; RUN: -r %t2.bc,_dead_func,pl \ ; RUN: -r %t2.bc,_another_dead_func,pl -; RUN: llvm-dis < %t.out.0.3.import.bc | FileCheck %s -; RUN: llvm-dis < %t.out.1.3.import.bc | FileCheck %s --check-prefix=CHECK2 +; RUN: llvm-dis < %t.out.0.3.import.bc | FileCheck %s --check-prefix=LTO2 +; RUN: llvm-dis < %t.out.1.3.import.bc | FileCheck %s --check-prefix=LTO2-CHECK2 ; RUN: llvm-nm %t.out.1 | FileCheck %s --check-prefix=CHECK2-NM ; RUN: llvm-bcanalyzer -dump %t.out.index.bc | FileCheck %s --check-prefix=COMBINED @@ -27,14 +27,14 @@ ; COMBINED-DAG: <COMBINED {{.*}} op2=55 ; Live, Internal ; COMBINED-DAG: <COMBINED {{.*}} op2=39 -; Live, External -; COMBINED-DAG: <COMBINED {{.*}} op2=32 -; COMBINED-DAG: <COMBINED {{.*}} op2=32 -; COMBINED-DAG: <COMBINED {{.*}} op2=32 -; (Dead) -; COMBINED-DAG: <COMBINED {{.*}} op2=0 -; COMBINED-DAG: <COMBINED {{.*}} op2=0 -; COMBINED-DAG: <COMBINED {{.*}} op2=0 +; Live, Local, External +; COMBINED-DAG: <COMBINED {{.*}} op2=96 +; COMBINED-DAG: <COMBINED {{.*}} op2=96 +; COMBINED-DAG: <COMBINED {{.*}} op2=96 +; Local, (Dead) +; COMBINED-DAG: <COMBINED {{.*}} op2=64 +; COMBINED-DAG: <COMBINED {{.*}} op2=64 +; COMBINED-DAG: <COMBINED {{.*}} op2=64 ; Dead-stripping on the index allows to internalize these, ; and limit the import of @baz thanks to early pruning. @@ -45,10 +45,18 @@ ; CHECK: define internal void @bar_internal() ; CHECK: define internal void @dead_func() { ; CHECK-NOT: available_externally {{.*}} @baz() +; LTO2-NOT: available_externally {{.*}} @baz() +; LTO2: @llvm.global_ctors = +; LTO2: define internal void @_GLOBAL__I_a() +; LTO2: define internal dso_local void @bar() { +; LTO2: define internal void @bar_internal() +; LTO2: define internal dso_local void @dead_func() { +; LTO2-NOT: available_externally {{.*}} @baz() ; Make sure we didn't internalize @boo, which is reachable via ; llvm.global_ctors ; CHECK2: define void @boo() +; LTO2-CHECK2: define dso_local void @boo() ; We should have eventually removed @baz since it was internalized and unused ; CHECK2-NM-NOT: _baz @@ -80,7 +88,7 @@ ; We can't internalize @dead_func because of the use in the regular LTO ; partition. -; CHECK-NOTDEAD: define void @dead_func() +; CHECK-NOTDEAD: define dso_local void @dead_func() ; We also can't eliminate @baz because it is in the regular LTO partition ; and called from @dead_func. ; CHECK-NM-NOTDEAD: T _baz diff --git a/test/ThinLTO/X86/funcimport2.ll b/test/ThinLTO/X86/funcimport2.ll index 7338f9a9d98..86ce715f4e0 100644 --- a/test/ThinLTO/X86/funcimport2.ll +++ b/test/ThinLTO/X86/funcimport2.ll @@ -7,7 +7,7 @@ ; RUN: -r=%t2.bc,_main,plx \ ; RUN: -r=%t2.bc,_foo,l ; RUN: llvm-dis %t.o.1.3.import.bc -o - | FileCheck %s -; CHECK: define available_externally void @foo() +; CHECK: define available_externally dso_local void @foo() ; We shouldn't do any importing at -O0 ; rm -f %t.o.1.3.import.bc @@ -17,7 +17,7 @@ ; RUN: -r=%t2.bc,_main,plx \ ; RUN: -r=%t2.bc,_foo,l ; RUN: llvm-dis %t.o.1.3.import.bc -o - | FileCheck %s --check-prefix=CHECKO0 -; CHECKO0: declare void @foo(...) +; CHECKO0: declare dso_local void @foo(...) target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.11.0" diff --git a/test/ThinLTO/X86/internalize.ll b/test/ThinLTO/X86/internalize.ll index 867e3e5a00a..f40fbcd4b41 100644 --- a/test/ThinLTO/X86/internalize.ll +++ b/test/ThinLTO/X86/internalize.ll @@ -1,4 +1,4 @@ -;; RUN: opt -module-summary %s -o %t1.bc +; RUN: opt -module-summary %s -o %t1.bc ; RUN: llvm-lto -thinlto-action=thinlink -o %t.index.bc %t1.bc ; RUN: llvm-lto -thinlto-action=internalize -thinlto-index %t.index.bc %t1.bc -o - | llvm-dis -o - | FileCheck %s --check-prefix=REGULAR ; RUN: llvm-lto -thinlto-action=internalize -thinlto-index %t.index.bc %t1.bc -o - --exported-symbol=foo | llvm-dis -o - | FileCheck %s --check-prefix=INTERNALIZE @@ -7,7 +7,7 @@ ; RUN: -r=%t1.bc,_foo,pxl \ ; RUN: -r=%t1.bc,_bar,pl \ ; RUN: -r=%t1.bc,_linkonce_func,pl -; RUN: llvm-dis < %t.o.0.2.internalize.bc | FileCheck %s --check-prefix=INTERNALIZE +; RUN: llvm-dis < %t.o.0.2.internalize.bc | FileCheck %s --check-prefix=INTERNALIZE2 ; REGULAR: define void @foo @@ -16,6 +16,9 @@ ; INTERNALIZE: define void @foo ; INTERNALIZE: define internal void @bar ; INTERNALIZE: define internal void @linkonce_func() +; INTERNALIZE2: define dso_local void @foo +; INTERNALIZE2: define internal dso_local void @bar +; INTERNALIZE2: define internal dso_local void @linkonce_func() target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.11.0" @@ -29,4 +32,4 @@ define void @bar() { } define linkonce void @linkonce_func() { ret void -}
\ No newline at end of file +} diff --git a/test/ThinLTO/X86/lazyload_metadata.ll b/test/ThinLTO/X86/lazyload_metadata.ll index a6d46e5586a..4680e462458 100644 --- a/test/ThinLTO/X86/lazyload_metadata.ll +++ b/test/ThinLTO/X86/lazyload_metadata.ll @@ -10,13 +10,13 @@ ; RUN: llvm-lto -thinlto-action=import %t2.bc -thinlto-index=%t3.bc \ ; RUN: -o /dev/null -stats \ ; RUN: 2>&1 | FileCheck %s -check-prefix=LAZY -; LAZY: 53 bitcode-reader - Number of Metadata records loaded +; LAZY: 55 bitcode-reader - Number of Metadata records loaded ; LAZY: 2 bitcode-reader - Number of MDStrings loaded ; RUN: llvm-lto -thinlto-action=import %t2.bc -thinlto-index=%t3.bc \ ; RUN: -o /dev/null -disable-ondemand-mds-loading -stats \ ; RUN: 2>&1 | FileCheck %s -check-prefix=NOTLAZY -; NOTLAZY: 62 bitcode-reader - Number of Metadata records loaded +; NOTLAZY: 64 bitcode-reader - Number of Metadata records loaded ; NOTLAZY: 7 bitcode-reader - Number of MDStrings loaded diff --git a/test/ThinLTO/X86/reference_non_importable.ll b/test/ThinLTO/X86/reference_non_importable.ll index 5cf225e95de..99b79ce198e 100644 --- a/test/ThinLTO/X86/reference_non_importable.ll +++ b/test/ThinLTO/X86/reference_non_importable.ll @@ -22,7 +22,7 @@ target triple = "x86_64-apple-macosx10.11.0" ; We want foo to be imported in the main module! ; RUN: llvm-dis < %t.o.1.3.import.bc | FileCheck %s --check-prefix=IMPORT -; IMPORT: define available_externally i8** @foo() +; IMPORT: define available_externally dso_local i8** @foo() define i8 **@foo() { ret i8 **@b } |