brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · 8c18bff Raw
81 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.16DEFINE: %{command} = llvm-lto2 run ../t1.bc ../t2.bc -o t.o \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 DTLTO. mock.py does not do any compilation, instead it simply writes23; the contents of the object files supplied on the command line into the24; output object files in job order.25RUN: %{command}26 27; Check that the expected output files have been created.28RUN: ls | count 229RUN: ls | FileCheck %s --check-prefix=THINLTO30 31; llvm-lto2 ThinLTO output files.32THINLTO-DAG: {{^}}t.o.1{{$}}33THINLTO-DAG: {{^}}t.o.2{{$}}34 35RUN: cd .. && rm -rf %t/out && mkdir %t/out && cd %t/out36 37; Perform DTLTO with --save-temps.38RUN: %{command} --save-temps39 40; Check that the expected output files have been created.41RUN: ls | count 1242RUN: ls | FileCheck %s --check-prefixes=THINLTO,SAVETEMPS43 44; Common -save-temps files from llvm-lto2.45SAVETEMPS-DAG: {{^}}t.o.resolution.txt{{$}}46SAVETEMPS-DAG: {{^}}t.o.index.bc{{$}}47SAVETEMPS-DAG: {{^}}t.o.index.dot{{$}}48 49; -save-temps incremental files.50SAVETEMPS-DAG: {{^}}t.o.0.0.preopt.bc{{$}}51SAVETEMPS-DAG: {{^}}t.o.0.2.internalize.bc{{$}}52 53; A jobs description JSON.54SAVETEMPS-DAG: {{^}}t.[[#]].dist-file.json{{$}}55 56; Summary shards emitted for DTLTO.57SAVETEMPS-DAG: {{^}}t1.1.[[#]].native.o.thinlto.bc{{$}}58SAVETEMPS-DAG: {{^}}t2.2.[[#]].native.o.thinlto.bc{{$}}59 60; DTLTO native output files (the results of the external backend compilations).61SAVETEMPS-DAG: {{^}}t1.1.[[#]].native.o{{$}}62SAVETEMPS-DAG: {{^}}t2.2.[[#]].native.o{{$}}63 64;--- t1.ll65 66target triple = "x86_64-unknown-linux-gnu"67target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"68 69define void @t1() {70  ret void71}72 73;--- t2.ll74 75target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"76target triple = "x86_64-unknown-linux-gnu"77 78define void @t2() {79  ret void80}81