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.so \
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.so \
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
30target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
31target triple = "x86_64-unknown-linux-gnu"
32
33define void @f() {
34entry:
35  ret void
36}
37
38!llvm.dbg.cu = !{}
39
40!1 = !{i32 2, !"Debug Info Version", i32 3}
41!llvm.module.flags = !{!1}
42