summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/FunctionImport
diff options
context:
space:
mode:
authorEugene Leviant <eleviant@accesssoftek.com>2018-02-16 08:11:04 +0000
committerEugene Leviant <eleviant@accesssoftek.com>2018-02-16 08:11:04 +0000
commit7331a0bf1c96a99bb47ecbdf9081e53f822eca66 (patch)
treed2f2927d5381f9c37e2039a8c86e56370fdfdf09 /llvm/test/Transforms/FunctionImport
parent3e2ae49a25f80a24e6cb5efdcb9c4caf42ba95ae (diff)
downloadbcm5719-llvm-7331a0bf1c96a99bb47ecbdf9081e53f822eca66.tar.gz
bcm5719-llvm-7331a0bf1c96a99bb47ecbdf9081e53f822eca66.zip
[ThinLTO] Import global variables
Differential revision: https://reviews.llvm.org/D43077 llvm-svn: 325320
Diffstat (limited to 'llvm/test/Transforms/FunctionImport')
-rw-r--r--llvm/test/Transforms/FunctionImport/funcimport.ll13
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm/test/Transforms/FunctionImport/funcimport.ll b/llvm/test/Transforms/FunctionImport/funcimport.ll
index 4ff51a33b5e..bb974b587e3 100644
--- a/llvm/test/Transforms/FunctionImport/funcimport.ll
+++ b/llvm/test/Transforms/FunctionImport/funcimport.ll
@@ -7,7 +7,8 @@
; RUN: opt -function-import -stats -print-imports -enable-import-metadata -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=INSTLIMDEF
; Try again with new pass manager
; RUN: opt -passes='function-import' -stats -print-imports -enable-import-metadata -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=INSTLIMDEF
-; "-stats" requires +Asserts.
+; RUN: opt -passes='function-import' -debug-only=function-import -enable-import-metadata -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=DUMP
+; "-stats" and "-debug-only" require +Asserts.
; REQUIRES: asserts
; Test import with smaller instruction limit
@@ -80,7 +81,7 @@ declare void @callfuncptr(...) #1
; Ensure that all uses of local variable @P which has used in setfuncptr
; and callfuncptr are to the same promoted/renamed global.
-; CHECK-DAG: @P.llvm.{{.*}} = external hidden global void ()*
+; CHECK-DAG: @P.llvm.{{.*}} = available_externally hidden global void ()* null
; CHECK-DAG: %0 = load void ()*, void ()** @P.llvm.
; CHECK-DAG: store void ()* @staticfunc2.llvm.{{.*}}, void ()** @P.llvm.
@@ -107,6 +108,8 @@ declare void @variadic(...)
; INSTLIMDEF-DAG: Import globalfunc2
; INSTLIMDEF-DAG: 13 function-import - Number of functions imported
+; INSTLIMDEF-DAG: 4 function-import - Number of global variables imported
+
; CHECK-DAG: !0 = !{!"{{.*}}/Inputs/funcimport.ll"}
; The actual GUID values will depend on path to test.
@@ -142,3 +145,9 @@ declare void @variadic(...)
; GUID-DAG: GUID {{.*}} is linkoncealias
; GUID-DAG: GUID {{.*}} is callfuncptr
; GUID-DAG: GUID {{.*}} is linkoncefunc
+
+; DUMP: Module [[M1:.*]] imports from 1 module
+; DUMP-NEXT: 13 functions imported from [[M2:.*]]
+; DUMP-NEXT: 4 vars imported from [[M2]]
+; DUMP: Imported 13 functions for Module [[M1]]
+; DUMP-NEXT: Imported 4 global variables for Module [[M1]]
OpenPOWER on IntegriCloud