1; First generate bitcode with a module summary index for each file 2; RUN: opt -module-summary %s -o %t.o 3; RUN: opt -module-summary %p/Inputs/thinlto_emit_linked_objects.ll -o %t2.o 4 5; Next do the ThinLink step, specifying thinlto-index-only so that the gold 6; plugin exits after generating individual indexes. The objects the linker 7; decided to include in the link should be emitted into the file specified 8; after 'thinlto-index-only='. In this version of the test, only %t.o will 9; be included in the link, and not %t2.o since it is within 10; a library (--start-lib/--end-lib pair) and not strongly referenced. 11; Note that the support for detecting this is in gold v1.12. 12; RUN: rm -f %t.o.thinlto.bc 13; RUN: rm -f %t2.o.thinlto.bc 14; RUN: rm -f %t.o.imports 15; RUN: rm -f %t2.o.imports 16; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \ 17; RUN: --plugin-opt=thinlto \ 18; RUN: --plugin-opt=thinlto-index-only=%t3 \ 19; RUN: --plugin-opt=thinlto-emit-imports-files \ 20; RUN: -m elf_x86_64 \ 21; RUN: -o %t4 \ 22; RUN: %t.o \ 23; RUN: --start-lib %t2.o --end-lib 24 25; Ensure that the expected output files are created, even for the file 26; the linker decided not to include in the link. 27; RUN: ls %t.o.thinlto.bc 28; RUN: ls %t2.o.thinlto.bc 29; RUN: ls %t.o.imports 30; RUN: ls %t2.o.imports 31 32; RUN: cat %t3 | FileCheck %s 33; CHECK: thinlto_emit_linked_objects.ll.tmp.o 34; CHECK-NOT: thinlto_emit_linked_objects.ll.tmp2.o 35 36target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 37target triple = "x86_64-unknown-linux-gnu" 38 39define i32 @main() { 40entry: 41 ret i32 0 42} 43