brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.8 KiB · ee1c428 Raw
97 lines · plain
1; Check that the JSON output from DTLTO is as expected. Note that validate.py2; checks the JSON structure so we just check the field contents in this test.3 4RUN: rm -rf %t && split-file %s %t && cd %t5 6; Generate bitcode files with summary.7RUN: opt -thinlto-bc t1.ll -o t1.bc8RUN: opt -thinlto-bc t2.ll -o t2.bc9 10; Perform DTLTO with clang.11RUN: not llvm-lto2 run t1.bc t2.bc -o my.output \12RUN:     -r=t1.bc,t1,px -r=t2.bc,t2,px \13RUN:     -dtlto-distributor=%python \14RUN:     -dtlto-distributor-arg=%llvm_src_root/utils/dtlto/validate.py,--da1=10,--da2=10 \15RUN:     -dtlto-compiler=my_clang.exe \16RUN:     -dtlto-compiler-arg=--rota1=10,--rota2=20 \17RUN:   2>&1 | FileCheck --check-prefixes=CHECK,CLANG %s18 19; Perform DTLTO with LLVM driver.20RUN: not llvm-lto2 run t1.bc t2.bc -o my.output \21RUN:     -r=t1.bc,t1,px -r=t2.bc,t2,px \22RUN:     -dtlto-distributor=%python \23RUN:     -dtlto-distributor-arg=%llvm_src_root/utils/dtlto/validate.py,--da1=10,--da2=10 \24RUN:     -dtlto-compiler=llvm \25RUN:     -dtlto-compiler-prepend-arg=clang \26RUN:     -dtlto-compiler-arg=--rota1=10,--rota2=20 \27RUN:   2>&1 | FileCheck --check-prefixes=CHECK,LLVM %s28 29CHECK: distributor_args=['--da1=10', '--da2=10']30 31; Check the common object.32CHECK:      "linker_output": "my.output"33CHECK:      "args":34CLANG-NEXT: "my_clang.exe"35LLVM-NEXT:  "llvm"36LLVM-NEXT:  "clang"37CHECK-NEXT: "-c"38CHECK-NEXT: "--target=x86_64-unknown-linux-gnu"39CHECK-NEXT: "-O2"40CHECK-NEXT: "-fpic"41CHECK-NEXT: "-Wno-unused-command-line-argument"42CHECK-NEXT: "--rota1=10"43CHECK-NEXT: "--rota2=20"44CHECK-NEXT: ]45CHECK:      "inputs": []46 47; Check the first job entry.48CHECK:      "args":49CHECK-NEXT: "t1.bc"50CHECK-NEXT: "-fthinlto-index=t1.1.[[#]].native.o.thinlto.bc"51CHECK-NEXT: "-o"52CHECK-NEXT: "t1.1.[[#]].native.o"53CHECK-NEXT: ]54CHECK:      "inputs": [55CHECK-NEXT: "t1.bc"56CHECK-NEXT: "t1.1.[[#]].native.o.thinlto.bc"57CHECK-NEXT: ]58CHECK:      "outputs": [59CHECK-NEXT: "t1.1.[[#]].native.o"60CHECK-NEXT: ]61 62; Check the second job entry.63CHECK:      "args": [64CHECK-NEXT: "t2.bc"65CHECK-NEXT: "-fthinlto-index=t2.2.[[#]].native.o.thinlto.bc"66CHECK-NEXT: "-o"67CHECK-NEXT: "t2.2.[[#]].native.o"68CHECK-NEXT: ]69CHECK-NEXT: "inputs": [70CHECK-NEXT: "t2.bc"71CHECK-NEXT: "t2.2.[[#]].native.o.thinlto.bc"72CHECK-NEXT: ]73CHECK-NEXT: "outputs": [74CHECK-NEXT: "t2.2.[[#]].native.o"75CHECK-NEXT: ]76 77; This check ensures that we have failed for the expected reason.78CHECK: failed: DTLTO backend compilation: cannot open native object file:79 80;--- t1.ll81target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"82target triple = "x86_64-unknown-linux-gnu"83 84define void @t1() {85entry:86  ret void87}88 89;--- t2.ll90target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"91target triple = "x86_64-unknown-linux-gnu"92 93define void @t2() {94entry:95  ret void96}97