57 lines · plain
1REQUIRES: x862 3## Test that DTLTO-specific options are handled correctly.4 5RUN: rm -rf %t && split-file %s %t && cd %t6 7RUN: opt -thinlto-bc foo.ll -o foo.obj8 9## Not specifying a value for -thinlto-remote-compiler should result in an10## error if -thinlto-distributor is specified.11RUN: not lld-link /entry:foo /subsystem:console foo.obj /out:my.exe \12RUN: -thinlto-distributor:fake.exe 2>&1 | FileCheck %s --check-prefix=COMPILER13RUN: lld-link /entry:foo /subsystem:console foo.obj /out:my.exe14 15## Specifying an empty value for -thinlto-remote-compiler should result in an16## error if -thinlto-distributor is specified.17RUN: not lld-link /entry:foo /subsystem:console foo.obj /out:my.exe \18RUN: -thinlto-distributor:fake.exe \19RUN: -thinlto-remote-compiler:"" 2>&1 | FileCheck %s --check-prefix=COMPILER20RUN: lld-link /entry:foo /subsystem:console foo.obj /out:my.exe \21RUN: -thinlto-remote-compiler:""22 23COMPILER: error: A value must be specified for /thinlto-remote-compiler if /thinlto-distributor is specified.24 25## Test that DTLTO options are passed correctly to the distributor and26## remote compiler.27## Note: validate.py does not perform any compilation. Instead, it validates the28## received JSON, pretty-prints the JSON and the supplied arguments, and then29## exits with an error. This allows FileCheck directives to verify the30## distributor inputs.31RUN: not lld-link /entry:foo /subsystem:console foo.obj /out:my.exe \32RUN: -thinlto-distributor:%python \33RUN: -thinlto-distributor-arg:%llvm_src_root/utils/dtlto/validate.py \34RUN: -thinlto-distributor-arg:darg1=10 \35RUN: -thinlto-distributor-arg:darg2=20 \36RUN: -thinlto-remote-compiler:my_clang.exe \37RUN: -thinlto-remote-compiler-arg:carg1=20 \38RUN: -thinlto-remote-compiler-arg:carg2=30 2>&1 | FileCheck %s39 40CHECK: distributor_args=['darg1=10', 'darg2=20']41 42CHECK: "linker_output": "my.exe"43 44CHECK: "my_clang.exe"45CHECK: "carg1=20"46CHECK: "carg2=30"47 48CHECK: error: DTLTO backend compilation: cannot open native object file:49 50#--- foo.ll51target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"52target triple = "x86_64-pc-windows-msvc"53 54define void @foo() {55 ret void56}57