72 lines · plain
1; RUN: opt -module-summary %s -o %t1.bc2; RUN: opt -module-summary %p/Inputs/distributed_indexes.ll -o %t2.bc3; RUN: llvm-lto -thinlto-action=thinlink -o %t.index.bc %t1.bc %t2.bc4; RUN: llvm-lto -thinlto-action=distributedindexes -thinlto-index %t.index.bc %t1.bc %t2.bc5; RUN: llvm-bcanalyzer -dump %t1.bc.thinlto.bc | FileCheck %s --check-prefix=BACKEND16; RUN: llvm-bcanalyzer -dump %t2.bc.thinlto.bc | FileCheck %s --check-prefix=BACKEND27 8; The backend index for this module contains summaries from itself and9; Inputs/distributed_indexes.ll, as it imports from the latter.10; We should import @g and alias @analias. While we don't import the aliasee11; directly (and therefore don't have a third COMBINED_PROFILE record from module12; id 1), we will have a VALUE_GUID for it (hence the 4 VALUE_GUID entries).13; BACKEND1: <MODULE_STRTAB_BLOCK14; BACKEND1-NEXT: <ENTRY {{.*}} record string = '{{.*}}distributed_indexes.ll.tmp{{.*}}.bc'15; BACKEND1-NEXT: <ENTRY {{.*}} record string = '{{.*}}distributed_indexes.ll.tmp{{.*}}.bc'16; BACKEND1-NEXT: </MODULE_STRTAB_BLOCK17; BACKEND1-NEXT: <GLOBALVAL_SUMMARY_BLOCK18; BACKEND1-NEXT: <VERSION19; BACKEND1-DAG: <VALUE_GUID {{.*}} op0={{.*}}20; BACKEND1-DAG: <VALUE_GUID {{.*}} op0={{.*}}21; BACKEND1-DAG: <VALUE_GUID {{.*}} op0={{.*}}22; BACKEND1-DAG: <VALUE_GUID {{.*}} op0={{.*}}23; BACKEND1-DAG: <VALUE_GUID {{.*}} op0={{.*}}24; BACKEND1-NEXT: <COMBINED_PROFILE {{.*}} op1=025; BACKEND1-NEXT: <COMBINED_PROFILE {{.*}} op1=026; BACKEND1-NEXT: <COMBINED_PROFILE {{.*}} op1=127; BACKEND1-NEXT: <COMBINED_ALIAS {{.*}} op1=128; BACKEND1-NEXT: </GLOBALVAL_SUMMARY_BLOCK29 30; The backend index for Input/distributed_indexes.ll contains summaries from31; itself only, as it does not import anything.32; BACKEND2: <MODULE_STRTAB_BLOCK33; BACKEND2-NEXT: <ENTRY {{.*}} record string = '{{.*}}distributed_indexes.ll.tmp2.bc'34; BACKEND2-NEXT: </MODULE_STRTAB_BLOCK35; BACKEND2-NEXT: <GLOBALVAL_SUMMARY_BLOCK36; BACKEND2-NEXT: <VERSION37; BACKEND2-DAG: <VALUE_GUID {{.*}} op0={{.*}}38; BACKEND2-DAG: <VALUE_GUID {{.*}} op0={{.*}}39; BACKEND2-DAG: <VALUE_GUID {{.*}} op0={{.*}}40; BACKEND2-NEXT: <COMBINED41; BACKEND2-NEXT: <COMBINED42; BACKEND2-NEXT: <COMBINED_ALIAS43; BACKEND2-NEXT: </GLOBALVAL_SUMMARY_BLOCK44 45; Make sure that when the alias is imported as a copy of the aliasee, but the46; aliasee is not being imported by itself, that we can still print the summary.47; The aliasee should be "null".48; RUN: llvm-dis %t1.bc.thinlto.bc -o - | FileCheck %s --check-prefix=DIS49; DIS: aliasee: null50 51; RUN: opt -passes=function-import -import-all-index -summary-file=%t1.bc.thinlto.bc %t1.bc -S -o - 2>&1 | FileCheck %s --check-prefix=IR52; Tests that analias definition is imported.53; IR: define available_externally void @analias54 55target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"56 57declare void @g(...)58declare void @analias(...)59 60define void @f() {61entry:62 call void (...) @g()63 call void (...) @analias()64 ret void65}66 67; Ensure we don't get a COMBINED_ORIGINAL_NAME record in the distributed index.68; The BACKEND1-NEXT checks would fail if we did.69define internal void @x() {70 ret void71}72