11e2708c9STeresa Johnson; First generate bitcode with a module summary index for each file 21e2708c9STeresa Johnson; RUN: opt -module-summary %s -o %t.o 31e2708c9STeresa Johnson; RUN: opt -module-summary %p/Inputs/thinlto_emit_linked_objects.ll -o %t2.o 41e2708c9STeresa Johnson 51e2708c9STeresa Johnson; Next do the ThinLink step, specifying thinlto-index-only so that the gold 61e2708c9STeresa Johnson; plugin exits after generating individual indexes. The objects the linker 71e2708c9STeresa Johnson; decided to include in the link should be emitted into the file specified 81e2708c9STeresa Johnson; after 'thinlto-index-only='. Note that in this test both files should 91e2708c9STeresa Johnson; be included in the link, but in a case where there was an object in 101e2708c9STeresa Johnson; a library that had no strongly referenced symbols, that file would not 111e2708c9STeresa Johnson; be included in the link and listed in the emitted file. However, this 121e2708c9STeresa Johnson; requires gold version 1.12. 13*3efcfaddSEugene Leviant; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \ 141e2708c9STeresa Johnson; RUN: --plugin-opt=thinlto \ 151e2708c9STeresa Johnson; RUN: --plugin-opt=thinlto-index-only=%t3 \ 161e2708c9STeresa Johnson; RUN: -o %t5 \ 171e2708c9STeresa Johnson; RUN: %t.o \ 181e2708c9STeresa Johnson; RUN: --start-lib %t2.o --end-lib 191e2708c9STeresa Johnson 201e2708c9STeresa Johnson; RUN: cat %t3 | FileCheck %s 211e2708c9STeresa Johnson; CHECK: thinlto_emit_linked_objects.ll.tmp.o 221e2708c9STeresa Johnson; CHECK: thinlto_emit_linked_objects.ll.tmp2.o 231e2708c9STeresa Johnson 241e2708c9STeresa Johnsontarget datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 251e2708c9STeresa Johnsontarget triple = "x86_64-unknown-linux-gnu" 261e2708c9STeresa Johnson 271e2708c9STeresa Johnsondefine i32 @main() { 281e2708c9STeresa Johnsonentry: 291e2708c9STeresa Johnson call void (...) @foo() 301e2708c9STeresa Johnson ret i32 0 311e2708c9STeresa Johnson} 321e2708c9STeresa Johnson 331e2708c9STeresa Johnsondeclare void @foo(...) 34