52 lines · plain
1; Check that DTLTO creates identical summary index shard files as are created2; for an equivalent ThinLTO link.3 4RUN: rm -rf %t && split-file %s %t && cd %t5 6; Generate ThinLTO bitcode files.7RUN: opt -thinlto-bc t1.ll -o t1.bc8RUN: opt -thinlto-bc t2.ll -o t2.bc9 10; Generate fake object files for mock.py to return.11RUN: touch t1.o t2.o12 13; Define a substitution to share the common arguments.14DEFINE: %{command} = llvm-lto2 run t1.bc t2.bc -o t.o \15DEFINE: -r=t1.bc,t1,px \16DEFINE: -r=t2.bc,t2,px \17DEFINE: -r=t2.bc,t1 \18DEFINE: -thinlto-emit-indexes19 20; Perform DTLTO.21RUN: %{command} \22RUN: -dtlto-distributor=%python \23RUN: -dtlto-distributor-arg=%llvm_src_root/utils/dtlto/mock.py,t1.o,t2.o24 25; Perform ThinLTO.26RUN: %{command}27 28; Check for equivalence. We use a wildcard to account for the PID.29RUN: cmp t1.1.*.native.o.thinlto.bc t1.bc.thinlto.bc30RUN: cmp t2.2.*.native.o.thinlto.bc t2.bc.thinlto.bc31 32;--- t1.ll33target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"34target triple = "x86_64-unknown-linux-gnu"35 36define void @t1() {37entry:38 ret void39}40 41;--- t2.ll42target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"43target triple = "x86_64-unknown-linux-gnu"44 45declare void @t1(...)46 47define void @t2() {48entry:49 call void (...) @t1()50 ret void51}52