45 lines · plain
1; Test that DTLTO uses the target triple from the first file in the link.2 3RUN: rm -rf %t && split-file %s %t && cd %t4 5; Generate bitcode files with summary.6RUN: opt -thinlto-bc t1.ll -o t1.bc7RUN: opt -thinlto-bc t2.ll -o t2.bc8 9; Define a substitution to share the common DTLTO arguments. Note that the use10; of validate.py will cause a failure as it does not create output files.11DEFINE: %{command} = llvm-lto2 run -o t.o -save-temps \12DEFINE: -dtlto-distributor=%python \13DEFINE: -dtlto-distributor-arg=%llvm_src_root/utils/dtlto/validate.py \14DEFINE: -r=t1.bc,t1,px \15DEFINE: -r=t2.bc,t2,px16 17; Test case where t1.bc is first.18RUN: not %{command} t1.bc t2.bc 2>&1 | FileCheck %s \19RUN: --check-prefixes=TRIPLE1,ERR --implicit-check-not=--target20TRIPLE1: --target=x86_64-unknown-linux-gnu21 22; Test case where t2.bc is first.23RUN: not %{command} t2.bc t1.bc 2>&1 | FileCheck %s \24RUN: --check-prefixes=TRIPLE2,ERR --implicit-check-not=--target25TRIPLE2: --target=x86_64-unknown-unknown-gnu26 27; This check ensures that we have failed for the expected reason.28ERR: failed: DTLTO backend compilation: cannot open native object file:29 30;--- t1.ll31 32target triple = "x86_64-unknown-linux-gnu"33 34define void @t1() {35 ret void36}37 38;--- t2.ll39 40target triple = "x86_64-unknown-unknown-gnu"41 42define void @t2() {43 ret void44}45