llvm-project/lldb/lit/BuildScript/toolchain-clang-cl.test
Zachary Turner df0c7ec011 [build.py] Embed the output file name in generated object file names.
In compile-and-link mode, the user doesn't specify the name of the
object files to generate, because there could be multiple inputs
on a single command line and this would be hard to specify.  So the
script just tries to be smart and figure out the best object file
names.  However, if two build scripts are running in parallel and
using the same source files as input, they would previously race
to write the same object files, since the computed name only considered
the source file names when computing the object file names.

With this patch, we also consider the final executable name.  In a
way, this "namespaces" the generated object files so that as long
as the final executable file names don't clash, the intermediate
object file names won't clash either.

llvm-svn: 348511
2018-12-06 18:39:58 +00:00

50 lines
1.9 KiB
Plaintext

REQUIRES: lld, system-windows
RUN: %build -n --verbose --arch=32 --compiler=clang-cl --mode=compile-and-link -o %t/foo.exe foobar.c \
RUN: | FileCheck --check-prefix=CHECK-32 %s
RUN: %build -n --verbose --arch=64 --compiler=clang-cl --mode=compile-and-link -o %t/foo.exe foobar.c \
RUN: | FileCheck --check-prefix=CHECK-64 %s
CHECK-32: Script Arguments:
CHECK-32: Arch: 32
CHECK-32: Compiler: clang-cl
CHECK-32: Outdir: {{.*}}
CHECK-32: Output: {{.*}}toolchain-clang-cl.test.tmp\foo.exe
CHECK-32: Nodefaultlib: False
CHECK-32: Opt: none
CHECK-32: Mode: compile
CHECK-32: Clean: True
CHECK-32: Verbose: True
CHECK-32: Dryrun: True
CHECK-32: Inputs: foobar.c
CHECK-32: Cleaning {{.*}}toolchain-clang-cl.test.tmp{{.}}foobar.ilk
CHECK-32: Cleaning {{.*}}toolchain-clang-cl.test.tmp{{.}}foo.exe-foobar.obj
CHECK-32: Cleaning {{.*}}toolchain-clang-cl.test.tmp{{.}}foo.pdb
CHECK-32: Cleaning {{.*}}toolchain-clang-cl.test.tmp{{.}}foo.exe
CHECK-32: compiling foobar.c -> foo.exe-foobar.obj
CHECK-32: {{.*}}clang-cl{{(.exe)?}} -m32
CHECK-32: linking foo.exe-foobar.obj -> foo.exe
CHECK-32: {{.*}}lld-link
CHECK-64: Script Arguments:
CHECK-64: Arch: 64
CHECK-64: Compiler: clang-cl
CHECK-64: Outdir: {{.*}}
CHECK-64: Output: {{.*}}toolchain-clang-cl.test.tmp\foo.exe
CHECK-64: Nodefaultlib: False
CHECK-64: Opt: none
CHECK-64: Mode: compile
CHECK-64: Clean: True
CHECK-64: Verbose: True
CHECK-64: Dryrun: True
CHECK-64: Inputs: foobar.c
CHECK-64: Cleaning {{.*}}toolchain-clang-cl.test.tmp{{.}}foobar.ilk
CHECK-64: Cleaning {{.*}}toolchain-clang-cl.test.tmp{{.}}foo.exe-foobar.obj
CHECK-64: Cleaning {{.*}}toolchain-clang-cl.test.tmp{{.}}foo.pdb
CHECK-64: Cleaning {{.*}}toolchain-clang-cl.test.tmp{{.}}foo.exe
CHECK-64: compiling foobar.c -> foo.exe-foobar.obj
CHECK-64: {{.*}}clang-cl{{(.exe)?}} -m64
CHECK-64: linking foo.exe-foobar.obj -> foo.exe
CHECK-64: {{.*}}lld-link{{(.exe)?}}