68 lines · plain
1; Test DTLTO output with llvm-lto2.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; Generate fake object files for mock.py to return.10RUN: touch t1.o t2.o11 12; Create an empty subdirectory to avoid having to account for the input files.13RUN: mkdir %t/out && cd %t/out14 15; Define a substitution to share the common DTLTO arguments with caching enabled.16DEFINE: %{command} = llvm-lto2 run ../t1.bc ../t2.bc -o t.o -cache-dir cache-dir \17DEFINE: -dtlto-distributor=%python \18DEFINE: -dtlto-distributor-arg=%llvm_src_root/utils/dtlto/mock.py,../t1.o,../t2.o \19DEFINE: -r=../t1.bc,t1,px \20DEFINE: -r=../t2.bc,t2,px21 22; Perform out of process ThinLTO (DTLTO). 23; Note: mock.py does not do any compilation, instead it simply writes24; the contents of the object files supplied on the command line into the25; output object files in job order.26RUN: %{command}27 28; Check that the expected output files have been created.29RUN: ls | count 330; Check that two native object files has been created31RUN: ls | FileCheck %s --check-prefix=THINLTO32; Check that DTLTO cache directory has been created33RUN: ls cache-dir/* | count 234; Check that 2 cache entries are created35RUN: ls cache-dir/llvmcache-* | count 236 37; llvm-lto2 ThinLTO output files.38THINLTO-DAG: {{^}}t.o.1{{$}}39THINLTO-DAG: {{^}}t.o.2{{$}}40 41# Execute llvm-lto2 again and check that a fully populated cache is used correctly, 42# i.e., no additional cache entries are created for cache hits.43 44RUN: %{command}45 46RUN: ls | count 347RUN: ls | FileCheck %s --check-prefix=THINLTO48RUN: ls cache-dir/* | count 249RUN: ls cache-dir/llvmcache-* | count 250 51;--- t1.ll52 53target triple = "x86_64-unknown-linux-gnu"54target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"55 56define void @t1() {57 ret void58}59 60;--- t2.ll61 62target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"63target triple = "x86_64-unknown-linux-gnu"64 65define void @t2() {66 ret void67}68