1 ; Generate summary sections and test gold handling.
2 ; RUN: opt -module-summary %s -o %t.o
3 ; RUN: opt -module-summary %p/Inputs/thinlto.ll -o %t2.o
4 ; Include a file with an empty module summary index, to ensure that the expected
5 ; output files are created regardless, for a distributed build system.
6 ; RUN: opt -module-summary %p/Inputs/thinlto_empty.ll -o %t3.o
8 ; Ensure gold generates imports files if requested for distributed backends.
9 ; RUN: rm -f %t3.o.imports %t3.o.thinlto.bc
10 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \
11 ; RUN: --plugin-opt=thinlto \
12 ; RUN: --plugin-opt=thinlto-index-only \
13 ; RUN: --plugin-opt=thinlto-emit-imports-files \
14 ; RUN: -shared %t.o %t2.o %t3.o -o %t4
16 ; The imports file for this module contains the bitcode file for
18 ; RUN: cat %t.o.imports | count 1
19 ; RUN: cat %t.o.imports | FileCheck %s --check-prefix=IMPORTS1
20 ; IMPORTS1: test/tools/gold/X86/Output/thinlto_emit_imports.ll.tmp2.o
22 ; The imports file for Input/thinlto.ll is empty as it does not import anything.
23 ; RUN: cat %t2.o.imports | count 0
25 ; The imports file for Input/thinlto_empty.ll is empty but should exist.
26 ; RUN: cat %t3.o.imports | count 0
28 ; The index file should be created even for the input with an empty summary.
29 ; RUN: ls %t3.o.thinlto.bc
31 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"