74 lines · plain
1; Check that DTLTO creates imports lists correctly.2 3RUN: rm -rf %t && split-file %s %t && cd %t4 5; Generate ThinLTO bitcode files.6RUN: opt -thinlto-bc 0.ll -o 0.bc -O27RUN: opt -thinlto-bc 1.ll -o 1.bc -O28 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 0.bc 1.bc -o t.o \12DEFINE: -dtlto-distributor=%python \13DEFINE: -dtlto-distributor-arg=%llvm_src_root/utils/dtlto/validate.py \14DEFINE: -r=0.bc,g,px \15DEFINE: -r=1.bc,f,px \16DEFINE: -r=1.bc,g17 18; We expect an import from 0.bc into 1.bc but no imports into 0.bc. Check that19; the expected input files have been added to the JSON to account for this.20RUN: not %{command} 2>&1 | FileCheck %s --check-prefixes=INPUTS,ERR21 22; 1.bc should not appear in the list of inputs for 0.bc.23INPUTS: "jobs":24INPUTS: "inputs": [25INPUTS-NEXT: "0.bc",26INPUTS-NEXT: "0.1.[[#]].native.o.thinlto.bc"27INPUTS-NEXT: ]28 29; 0.bc should appear in the list of inputs for 1.bc.30INPUTS: "inputs": [31INPUTS-NEXT: "1.bc",32INPUTS-NEXT: "1.2.[[#]].native.o.thinlto.bc",33INPUTS-NEXT: "0.bc"34INPUTS-NEXT: ]35 36; This check ensures that we have failed for the expected reason.37ERR: failed: DTLTO backend compilation: cannot open native object file:38 39 40; Check that imports files are not created even if -save-temps is active.41RUN: not %{command} -save-temps 2>&1 \42RUN: | FileCheck %s --check-prefixes=ERR43RUN: ls | FileCheck %s --check-prefix=NOIMPORTSFILES44NOIMPORTSFILES-NOT: imports45 46 47; Check that imports files are created with -thinlto-emit-imports.48RUN: not %{command} -thinlto-emit-imports 2>&1 \49RUN: | FileCheck %s --check-prefixes=ERR50RUN: ls | FileCheck %s --check-prefix=IMPORTSFILES51IMPORTSFILES: 0.bc.imports52IMPORTSFILES: 1.bc.imports53 54;--- 0.ll55target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"56target triple = "x86_64-unknown-linux-gnu"57 58define void @g() {59entry:60 ret void61}62 63;--- 1.ll64target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"65target triple = "x86_64-unknown-linux-gnu"66 67declare void @g(...)68 69define void @f() {70entry:71 call void (...) @g()72 ret void73}74