Summary: This patch addresses an ambiguity in how our existing tests invoke the compiler. Roughly two thirds of our current "shell" tests invoke the compiler to build the executables for the host. However, there is also a significant number of tests which don't build a host binary (because they don't need to run it) and instead they hardcode a certain target. We also have code which adds a bunch of default arguments to the %clang substitutions. However, most of these arguments only really make sense for the host compilation. So far, this has worked mostly ok, because the arguments we were adding were not conflicting with the target-hardcoding tests (though they did provoke an occasional "argument unused" warning). However, this started to break down when we wanted to use target-hardcoding clang-cl tests (D69031) because clang-cl has a substantially different command line, and it was getting very confused by some of the arguments we were adding on non-windows hosts. This patch avoid this problem by creating separate %clang(xx,_cl)_host substutitions, which are specifically meant to be used for compiling host binaries. All funny host-specific options are moved there. To ensure that the regular %clang substitutions are not used for compiling host binaries (skipping the extra arguments) I employ a little hac^H^H^Htrick -- I add an invalid --target argument to the %clang substitution, which means that one has to use an explicit --target in order for the compilation to succeed. Reviewers: JDevlieghere, aprantl, mstorsjo, espindola Subscribers: emaste, arichardson, MaskRay, jfb, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69619
38 lines
1.3 KiB
Plaintext
38 lines
1.3 KiB
Plaintext
# REQUIRES: system-darwin
|
|
|
|
# Start fresh.
|
|
# RUN: rm -rf %t.repro
|
|
# RUN: rm -rf %t.root
|
|
# RUN: rm -rf %t.clang-cache
|
|
# RUN: rm -rf %t.lldb-cache
|
|
|
|
# Create a temporary root we can remove later.
|
|
# RUN: mkdir -p %t.root
|
|
# RUN: mkdir -p %t.clang-cache
|
|
# RUN: mkdir -p %t.lldb-cache
|
|
# RUN: cp %S/Inputs/main.cpp %t.root
|
|
# RUN: cp %S/Inputs/Foo.h %t.root
|
|
# RUN: cp %S/Inputs/Bar.h %t.root
|
|
# RUN: cp %S/Inputs/module.modulemap %t.root
|
|
|
|
# Compile the test case form the temporary root.
|
|
# RUN: %clang_host %t.root/main.cpp -g -fmodules -fcxx-modules -fmodules-cache-path=%t.clang-cache -o %t.root/a.out
|
|
|
|
# Capture the debug session.
|
|
# RUN: %lldb -x -b -o 'settings set symbols.clang-modules-cache-path %t.lldb-cache' -s %S/Inputs/ModuleCXX.in --capture --capture-path %t.repro %t.root/a.out | FileCheck %s --check-prefix CAPTURE
|
|
# CAPTURE: (success = 0)
|
|
|
|
# RUN: cat %t.repro/files.yaml | FileCheck %s --check-prefix YAML
|
|
# YAML-DAG: Foo.h
|
|
# YAML-DAG: Bar.h
|
|
# YAML-DAG: module.modulemap
|
|
|
|
# Remove the temporary root.
|
|
# RUN: rm -rf %t.root
|
|
# RUN: rm -rf %t.clang-cache
|
|
# RUN: rm -rf %t.lldb-cache
|
|
|
|
# Replay the debug session.
|
|
# RUN: %lldb -x -b -o 'settings set symbols.clang-modules-cache-path %t.lldb-cache' -s %S/Inputs/ModuleCXX.in --replay %t.repro %t.root/a.out | FileCheck %s --check-prefix REPLAY
|
|
# REPLAY: (success = 0)
|