1; First ensure that the ThinLTO handling in the gold plugin handles
2; bitcode without function summary sections gracefully.
3; RUN: llvm-as %s -o %t.o
4; RUN: llvm-as %p/Inputs/thinlto.ll -o %t2.o
5; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \
6; RUN:    --plugin-opt=thinlto \
7; RUN:    -shared %t.o %t2.o -o %t3
8
9; RUN: llvm-as -function-summary %s -o %t.o
10; RUN: llvm-as -function-summary %p/Inputs/thinlto.ll -o %t2.o
11
12; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \
13; RUN:    --plugin-opt=thinlto \
14; RUN:    -shared %t.o %t2.o -o %t3
15; RUN: llvm-bcanalyzer -dump %t3.thinlto.bc | FileCheck %s --check-prefix=COMBINED
16; RUN: not test -e %t3
17
18; COMBINED: <MODULE_STRTAB_BLOCK
19; COMBINED-NEXT: <ENTRY {{.*}} record string = '{{.*}}/test/tools/gold/X86/Output/thinlto.ll.tmp{{.*}}.o'
20; COMBINED-NEXT: <ENTRY {{.*}} record string = '{{.*}}/test/tools/gold/X86/Output/thinlto.ll.tmp{{.*}}.o'
21; COMBINED-NEXT: </MODULE_STRTAB_BLOCK
22; COMBINED-NEXT: <FUNCTION_SUMMARY_BLOCK
23; COMBINED-NEXT: <COMBINED_ENTRY
24; COMBINED-NEXT: <COMBINED_ENTRY
25; COMBINED-NEXT: </FUNCTION_SUMMARY_BLOCK
26; COMBINED-NEXT: <VALUE_SYMTAB
27; Check that the format is: op0=offset, op1=funcguid, where funcguid is
28; the lower 64 bits of the function name MD5.
29; COMBINED-NEXT: <COMBINED_FNENTRY abbrevid={{[0-9]+}} op0={{[0-9]+}} op1={{-3706093650706652785|-5300342847281564238}}
30; COMBINED-NEXT: <COMBINED_FNENTRY abbrevid={{[0-9]+}} op0={{[0-9]+}} op1={{-3706093650706652785|-5300342847281564238}}
31; COMBINED-NEXT: </VALUE_SYMTAB
32
33define void @f() {
34entry:
35  ret void
36}
37