1; Test to make sure the thinlto-object-suffix-replace option is handled 2; correctly. 3 4; Generate bitcode file with summary, as well as a minimized bitcode without 5; the debug metadata for the thin link. 6; RUN: opt -thinlto-bc %s -thin-link-bitcode-file=%t1.thinlink.bc -o %t1.o 7 8; First perform the thin link on the normal bitcode file, and save the 9; resulting index. 10; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \ 11; RUN: -m elf_x86_64 \ 12; RUN: --plugin-opt=thinlto \ 13; RUN: --plugin-opt=thinlto-index-only \ 14; RUN: -shared %t1.o -o %t3 15; RUN: cp %t1.o.thinlto.bc %t1.o.thinlto.bc.orig 16 17; Next perform the thin link on the minimized bitcode file, and compare dump 18; of the resulting index to the above dump to ensure they are identical. 19; RUN: rm -f %t1.o.thinlto.bc 20; Make sure it isn't inadvertently using the regular bitcode file. 21; RUN: rm -f %t1.o 22; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \ 23; RUN: -m elf_x86_64 \ 24; RUN: --plugin-opt=thinlto \ 25; RUN: --plugin-opt=thinlto-index-only \ 26; RUN: --plugin-opt=thinlto-object-suffix-replace=".thinlink.bc;.o" \ 27; RUN: -shared %t1.thinlink.bc -o %t3 28; RUN: diff %t1.o.thinlto.bc.orig %t1.o.thinlto.bc 29 30; If filename does not end with old suffix, no suffix change should occur, 31; so ".thinlto.bc" will simply be appended to the input file name. 32; RUN: rm -f %t1.thinlink.bc.thinlto.bc 33; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \ 34; RUN: -m elf_x86_64 \ 35; RUN: --plugin-opt=thinlto \ 36; RUN: --plugin-opt=thinlto-index-only \ 37; RUN: --plugin-opt=thinlto-object-suffix-replace=".abc;.o" \ 38; RUN: -shared %t1.thinlink.bc -o /dev/null 39; RUN: ls %t1.thinlink.bc.thinlto.bc 40 41target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 42target triple = "x86_64-unknown-linux-gnu" 43 44define void @f() { 45entry: 46 ret void 47} 48 49!llvm.dbg.cu = !{} 50 51!1 = !{i32 2, !"Debug Info Version", i32 3} 52!llvm.module.flags = !{!1} 53