diff options
Diffstat (limited to 'llvm/test/Bitcode')
-rw-r--r-- | llvm/test/Bitcode/thinlto-function-summary.ll | 4 | ||||
-rw-r--r-- | llvm/test/Bitcode/thinlto-summary-linkage-types.ll | 61 |
2 files changed, 63 insertions, 2 deletions
diff --git a/llvm/test/Bitcode/thinlto-function-summary.ll b/llvm/test/Bitcode/thinlto-function-summary.ll index d9531f7da89..e8d9b00d3eb 100644 --- a/llvm/test/Bitcode/thinlto-function-summary.ll +++ b/llvm/test/Bitcode/thinlto-function-summary.ll @@ -3,11 +3,11 @@ ; Check the value ids in the function summary entries against the ; same in the ValueSumbolTable, to ensure the ordering is stable. -; Also check the islocal flag on the summary entries. +; Also check the linkage field on the summary entries. ; BC: <FUNCTION_SUMMARY_BLOCK ; BC-NEXT: <PERMODULE_ENTRY {{.*}} op0=1 op1=0 ; BC-NEXT: <PERMODULE_ENTRY {{.*}} op0=2 op1=0 -; BC-NEXT: <PERMODULE_ENTRY {{.*}} op0=4 op1=1 +; BC-NEXT: <PERMODULE_ENTRY {{.*}} op0=4 op1=3 ; BC-NEXT: </FUNCTION_SUMMARY_BLOCK ; BC-NEXT: <VALUE_SYMTAB ; BC-NEXT: <FNENTRY {{.*}} op0=1 {{.*}}> record string = 'foo' diff --git a/llvm/test/Bitcode/thinlto-summary-linkage-types.ll b/llvm/test/Bitcode/thinlto-summary-linkage-types.ll new file mode 100644 index 00000000000..5b7391e238f --- /dev/null +++ b/llvm/test/Bitcode/thinlto-summary-linkage-types.ll @@ -0,0 +1,61 @@ +; Check the linkage types in both the per-module and combined summaries. +; RUN: llvm-as -function-summary %s -o %t.o +; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s +; RUN: llvm-lto -thinlto -o %t2 %t.o +; RUN: llvm-bcanalyzer -dump %t2.thinlto.bc | FileCheck %s --check-prefix=COMBINED + +define private void @private() +; CHECK: <PERMODULE_ENTRY {{.*}} op1=9 +; COMBINED-DAG: <COMBINED_ENTRY {{.*}} op1=9 +{ + ret void +} + +define internal void @internal() +; CHECK: <PERMODULE_ENTRY {{.*}} op1=3 +; COMBINED-DAG: <COMBINED_ENTRY {{.*}} op1=3 +{ + ret void +} + +define available_externally void @available_externally() +; CHECK: <PERMODULE_ENTRY {{.*}} op1=12 +; COMBINED-DAG: <COMBINED_ENTRY {{.*}} op1=12 +{ + ret void +} + +define linkonce void @linkonce() +; CHECK: <PERMODULE_ENTRY {{.*}} op1=18 +; COMBINED-DAG: <COMBINED_ENTRY {{.*}} op1=18 +{ + ret void +} + +define weak void @weak() +; CHECK: <PERMODULE_ENTRY {{.*}} op1=16 +; COMBINED-DAG: <COMBINED_ENTRY {{.*}} op1=16 +{ + ret void +} + +define linkonce_odr void @linkonce_odr() +; CHECK: <PERMODULE_ENTRY {{.*}} op1=19 +; COMBINED-DAG: <COMBINED_ENTRY {{.*}} op1=19 +{ + ret void +} + +define weak_odr void @weak_odr() +; CHECK: <PERMODULE_ENTRY {{.*}} op1=17 +; COMBINED-DAG: <COMBINED_ENTRY {{.*}} op1=17 +{ + ret void +} + +define external void @external() +; CHECK: <PERMODULE_ENTRY {{.*}} op1=0 +; COMBINED-DAG: <COMBINED_ENTRY {{.*}} op1=0 +{ + ret void +} |