[lldb/lit] Introduce %clang_host substitutions

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
This commit is contained in:
Pavel Labath committed 2019-10-31 10:40:37 +01:00
1 parent a7aee6c47a
commit 9c73925226
60 files changed
+75 -69

No files matched your search

@@ -3,7 +3,7 @@
# RUN: echo 'run' >> %t.in
# RUN: echo 'command script import %S/Inputs/frame.py' >> %t.in
# RUN: %clang -g -O0 %S/Inputs/main.c -o %t.out
# RUN: %clang_host -g -O0 %S/Inputs/main.c -o %t.out
# RUN: %lldb -b -s %t.in -o 'script print("script: {}".format(lldb.frame))' %t.out | FileCheck %s
# Make sure that we don't have access to lldb.frame from the Python script.
+1 -1
View File
@@ -1,5 +1,5 @@
# Make sure lldb can handle filenames with single quotes in them.
# RUN: %clang %p/Inputs/hello.c -g -o "%t-'pat"
# RUN: %clang_host %p/Inputs/hello.c -g -o "%t-'pat"
# RUN: %lldb -s %s "%t-'pat" | FileCheck %s
br set -p return
+1 -1
View File
@@ -1,7 +1,7 @@
# Make sure lldb resolves the target path.
# RUN: mkdir -p %t/foo
# RUN: cd %t/foo
# RUN: %clang %p/Inputs/hello.c -g -o a.out
# RUN: %clang_host %p/Inputs/hello.c -g -o a.out
# RUN: %lldb -b a.out | FileCheck %s
# CHECK: Current executable set to '{{.*}}foo{{[/\\\\]+}}a.out'
@@ -1,4 +1,4 @@
# RUN: %clangxx -std=c++11 %p/Inputs/stop-hook-threads.cpp -g -o %t
# RUN: %clangxx_host -std=c++11 %p/Inputs/stop-hook-threads.cpp -g -o %t
# RUN: %lldb -b -s %p/Inputs/stop-hook-threads-1.lldbinit -s %s -f %t \
# RUN: | FileCheck --check-prefix=CHECK --check-prefix=CHECK-NO-FILTER %s
# RUN: %lldb -b -s %p/Inputs/stop-hook-threads-2.lldbinit -s %s -f %t \
@@ -1,4 +1,4 @@
# RUN: %clang %p/Inputs/stop-hook.c -g -o %t
# RUN: %clang_host %p/Inputs/stop-hook.c -g -o %t
# Test setting stop-hook per-function
# RUN: %lldb -b -s %p/Inputs/stop-hook-1.lldbinit -s %s -f %t \
# RUN: | FileCheck --check-prefix=CHECK --check-prefix=CHECK-FUNC %s
+1 -1
View File
@@ -1,6 +1,6 @@
# UNSUPPORTED: system-windows
# RUN: %clangxx %p/Inputs/call-function.cpp -g -o %t
# RUN: %clangxx_host %p/Inputs/call-function.cpp -g -o %t
# RUN: lldb-test ir-memory-map %t %S/Inputs/ir-memory-map-basic
# RUN: lldb-test ir-memory-map -host-only %t %S/Inputs/ir-memory-map-basic
@@ -1,6 +1,6 @@
# REQUIRES: system-windows
# RUN: %clang_cl /Zi /GS- %p/Inputs/call-function.cpp /c /o %t.obj
# RUN: %clang_cl_host /Zi /GS- %p/Inputs/call-function.cpp /c /o %t.obj
# RUN: %msvc_link /debug:full %t.obj /out:%t
# RUN: lldb-test ir-memory-map %t %S/Inputs/ir-memory-map-basic
+1 -1
View File
@@ -1,5 +1,5 @@
# REQUIRES: system-darwin
# RUN: %clang %p/Inputs/cstr.c -g -o %t
# RUN: %clang_host %p/Inputs/cstr.c -g -o %t
# RUN: %lldb -b -s %s -f %t | FileCheck %s
br set -p return
+1 -1
View File
@@ -7,7 +7,7 @@
# XFAIL: system-netbsd
# XFAIL: system-openbsd
# RUN: %clang %S/Inputs/simple.c -g -o %t.out
# RUN: %clang_host %S/Inputs/simple.c -g -o %t.out
# RUN: SHELL=bogus %lldb %t.out -b -o 'run' 2>&1 | FileCheck %s --check-prefix ERROR
# RUN: env -i %lldb %t.out -b -o 'run' 2>&1 | FileCheck %s
@@ -3,7 +3,7 @@
# We want to keep the symbol "multiplyByThree" in the .dynamic section and not
# have it put the default .symtab section.
# RUN: echo "{multiplyByThree;};" > %T/dynmic-symbols.txt
# RUN: %clang -Wl,--dynamic-list=%T/dynmic-symbols.txt -g -o %t.binary %p/Inputs/minidebuginfo-main.c
# RUN: %clang_host -Wl,--dynamic-list=%T/dynmic-symbols.txt -g -o %t.binary %p/Inputs/minidebuginfo-main.c
# The following section is adapted from GDB's official documentation:
# http://sourceware.org/gdb/current/onlinedocs/gdb/MiniDebugInfo.html#MiniDebugInfo
+1 -1
View File
@@ -2,7 +2,7 @@ UNSUPPORTED: system-windows
The double quotes around "BAR" ensure we don't match the command.
RUN: %clangxx -std=c++11 %p/Inputs/env.cpp -o %t
RUN: %clangxx_host -std=c++11 %p/Inputs/env.cpp -o %t
RUN: %lldb %t -o 'process launch --environment FOO="BAR"' | FileCheck %s
RUN: %lldb %t -o 'env FOO="BAR"' -o 'process launch' | FileCheck %s
@@ -1,5 +1,5 @@
# REQUIRES: native && target-aarch64
# RUN: %clangxx -fomit-frame-pointer %p/Inputs/aarch64-fp-read.cpp -o %t
# RUN: %clangxx_host -fomit-frame-pointer %p/Inputs/aarch64-fp-read.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
@@ -1,5 +1,5 @@
# REQUIRES: native && target-aarch64
# RUN: %clangxx -fomit-frame-pointer %p/Inputs/aarch64-gp-read.cpp -o %t
# RUN: %clangxx_host -fomit-frame-pointer %p/Inputs/aarch64-gp-read.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
+1 -1
View File
@@ -1,5 +1,5 @@
# REQUIRES: native && target-arm
# RUN: %clangxx -fomit-frame-pointer %p/Inputs/arm-fp-read.cpp -o %t
# RUN: %clangxx_host -fomit-frame-pointer %p/Inputs/arm-fp-read.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
+1 -1
View File
@@ -1,5 +1,5 @@
# REQUIRES: native && target-arm
# RUN: %clangxx -fomit-frame-pointer %p/Inputs/arm-gp-read.cpp -o %t
# RUN: %clangxx_host -fomit-frame-pointer %p/Inputs/arm-gp-read.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
+1 -1
View File
@@ -1,6 +1,6 @@
# XFAIL: system-windows
# REQUIRES: native && target-x86_64
# RUN: %clangxx -fomit-frame-pointer %p/Inputs/x86-64-gp-read.cpp -o %t
# RUN: %clangxx_host -fomit-frame-pointer %p/Inputs/x86-64-gp-read.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
@@ -1,6 +1,6 @@
# UNSUPPORTED: system-darwin
# REQUIRES: native && target-x86_64
# RUN: %clangxx -fomit-frame-pointer %p/Inputs/x86-64-gp-write.cpp -o %t
# RUN: %clangxx_host -fomit-frame-pointer %p/Inputs/x86-64-gp-write.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
+1 -1
View File
@@ -1,6 +1,6 @@
# XFAIL: system-windows
# REQUIRES: native && target-x86_64
# RUN: %clangxx %p/Inputs/x86-64-read.cpp -o %t
# RUN: %clangxx_host %p/Inputs/x86-64-read.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
+1 -1
View File
@@ -1,7 +1,7 @@
# XFAIL: system-darwin
# XFAIL: system-windows
# REQUIRES: native && (target-x86 || target-x86_64) && native-cpu-sse
# RUN: %clangxx %p/Inputs/x86-64-write.cpp -o %t
# RUN: %clangxx_host %p/Inputs/x86-64-write.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
@@ -4,7 +4,7 @@
# XFAIL: system-windows
# XFAIL: system-darwin
# REQUIRES: native && target-x86_64 && native-cpu-avx512f
# RUN: %clangxx %p/Inputs/x86-zmm-read.cpp -o %t
# RUN: %clangxx_host %p/Inputs/x86-zmm-read.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
@@ -4,7 +4,7 @@
# XFAIL: system-netbsd
# XFAIL: system-windows
# REQUIRES: native && target-x86 && native-cpu-avx512f
# RUN: %clangxx %p/Inputs/x86-zmm-write.cpp -o %t
# RUN: %clangxx_host %p/Inputs/x86-zmm-write.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
@@ -1,6 +1,6 @@
# XFAIL: system-windows
# REQUIRES: native && target-x86_64 && native-cpu-avx
# RUN: %clangxx %p/Inputs/x86-ymm-read.cpp -o %t
# RUN: %clangxx_host %p/Inputs/x86-ymm-read.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
@@ -1,7 +1,7 @@
# XFAIL: system-darwin
# XFAIL: system-windows
# REQUIRES: native && target-x86_64 && native-cpu-avx
# RUN: %clangxx %p/Inputs/x86-ymm-write.cpp -o %t
# RUN: %clangxx_host %p/Inputs/x86-ymm-write.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
@@ -4,7 +4,7 @@
# XFAIL: system-windows
# XFAIL: system-darwin
# REQUIRES: native && target-x86_64 && native-cpu-avx512f
# RUN: %clangxx %p/Inputs/x86-zmm-read.cpp -o %t
# RUN: %clangxx_host %p/Inputs/x86-zmm-read.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
@@ -4,7 +4,7 @@
# XFAIL: system-netbsd
# XFAIL: system-windows
# REQUIRES: native && target-x86 && native-cpu-avx512f
# RUN: %clangxx %p/Inputs/x86-zmm-write.cpp -o %t
# RUN: %clangxx_host %p/Inputs/x86-zmm-write.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
@@ -3,7 +3,7 @@
# XFAIL: system-netbsd
# XFAIL: system-windows
# REQUIRES: native && target-x86_64 && native-cpu-avx512f
# RUN: %clangxx %p/Inputs/x86-zmm-read.cpp -o %t
# RUN: %clangxx_host %p/Inputs/x86-zmm-read.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
@@ -4,7 +4,7 @@
# XFAIL: system-netbsd
# XFAIL: system-windows
# REQUIRES: native && target-x86_64 && native-cpu-avx512f
# RUN: %clangxx %p/Inputs/x86-zmm-write.cpp -o %t
# RUN: %clangxx_host %p/Inputs/x86-zmm-write.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
+1 -1
View File
@@ -1,6 +1,6 @@
# XFAIL: system-windows
# REQUIRES: native && target-x86
# RUN: %clangxx -fomit-frame-pointer %p/Inputs/x86-gp-read.cpp -o %t
# RUN: %clangxx_host -fomit-frame-pointer %p/Inputs/x86-gp-read.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
+1 -1
View File
@@ -1,6 +1,6 @@
# XFAIL: system-windows
# REQUIRES: native && target-x86
# RUN: %clangxx -fomit-frame-pointer %p/Inputs/x86-gp-write.cpp -o %t
# RUN: %clangxx_host -fomit-frame-pointer %p/Inputs/x86-gp-write.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
@@ -1,7 +1,7 @@
# XFAIL: system-darwin
# XFAIL: system-windows
# REQUIRES: native && (target-x86 || target-x86_64) && native-cpu-sse
# RUN: %clangxx %p/Inputs/x86-mm-xmm-read.cpp -o %t
# RUN: %clangxx_host %p/Inputs/x86-mm-xmm-read.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
@@ -1,7 +1,7 @@
# XFAIL: system-darwin
# XFAIL: system-windows
# REQUIRES: native && (target-x86 || target-x86_64) && native-cpu-sse
# RUN: %clangxx %p/Inputs/x86-mm-xmm-write.cpp -o %t
# RUN: %clangxx_host %p/Inputs/x86-mm-xmm-write.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
+1 -1
View File
@@ -1,6 +1,6 @@
# XFAIL: system-windows
# REQUIRES: native && target-x86 && native-cpu-avx
# RUN: %clangxx %p/Inputs/x86-ymm-read.cpp -o %t
# RUN: %clangxx_host %p/Inputs/x86-ymm-read.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
+1 -1
View File
@@ -1,6 +1,6 @@
# XFAIL: system-windows
# REQUIRES: native && target-x86 && native-cpu-avx
# RUN: %clangxx %p/Inputs/x86-ymm-write.cpp -o %t
# RUN: %clangxx_host %p/Inputs/x86-ymm-write.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
+1 -1
View File
@@ -3,7 +3,7 @@
# XFAIL: system-netbsd
# XFAIL: system-windows
# REQUIRES: native && target-x86 && native-cpu-avx512f
# RUN: %clangxx %p/Inputs/x86-zmm-read.cpp -o %t
# RUN: %clangxx_host %p/Inputs/x86-zmm-read.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
+1 -1
View File
@@ -3,7 +3,7 @@
# XFAIL: system-netbsd
# XFAIL: system-windows
# REQUIRES: native && target-x86 && native-cpu-avx512f
# RUN: %clangxx %p/Inputs/x86-zmm-write.cpp -o %t
# RUN: %clangxx_host %p/Inputs/x86-zmm-write.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
process launch
@@ -3,7 +3,7 @@
# This tests that data formatters continue to work when replaying a reproducer.
# RUN: rm -rf %t.repro
# RUN: %clangxx %S/Inputs/foo.cpp -g -o %t.out
# RUN: %clangxx_host %S/Inputs/foo.cpp -g -o %t.out
# RUN: %lldb -x -b -s %S/Inputs/DataFormatter.in --capture --capture-path %t.repro %t.out | FileCheck %s
# RUN: %lldb --replay %t.repro | FileCheck %s
@@ -3,7 +3,7 @@
# This tests that image list works when replaying. We arbitrarily assume
# there's at least two entries and compare that they're identical.
# RUN: %clang %S/Inputs/stepping.c -g -o %t.out
# RUN: %clang_host %S/Inputs/stepping.c -g -o %t.out
# RUN: rm -rf %t.txt
@@ -3,7 +3,7 @@
# This tests that stepping continues to work when replaying a reproducer.
# RUN: rm -rf %t.repro
# RUN: %clang %S/Inputs/stepping.c -O0 -g -o %t.out
# RUN: %clang_host %S/Inputs/stepping.c -O0 -g -o %t.out
# RUN: grep -v '#' %s > %t.in
# RUN: %lldb -x -b -s %t.in --capture --capture-path %t.repro %t.out | FileCheck %s --check-prefix CHECK
@@ -16,7 +16,7 @@
# RUN: cp %S/Inputs/module.modulemap %t.root
# Compile the test case form the temporary root.
# RUN: %clang %t.root/main.cpp -g -fmodules -fcxx-modules -fmodules-cache-path=%t.clang-cache -o %t.root/a.out
# 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
+1 -1
View File
@@ -4,7 +4,7 @@
# Generate a reproducer.
# RUN: mkdir -p %t
# RUN: rm -rf %t.repro
# RUN: %clang %S/Inputs/simple.c -g -o %t/reproducer.out
# RUN: %clang_host %S/Inputs/simple.c -g -o %t/reproducer.out
# RUN: %lldb -x -b -s %S/Inputs/FileCapture.in -o 'reproducer dump -p files' --capture --capture-path %t.repro %t/reproducer.out
# RUN: %lldb -b -o 'reproducer dump -p files -f %t.repro' | FileCheck %s --check-prefix FILES
@@ -7,7 +7,7 @@
# that the string "testing" is not printed.
# RUN: rm -rf %t.repro
# RUN: %clang %S/Inputs/simple.c -g -o %t.out
# RUN: %clang_host %S/Inputs/simple.c -g -o %t.out
# RUN: %lldb -x -b -s %S/Inputs/FileCapture.in --capture --capture-path %t.repro %t.out | FileCheck %s --check-prefix CHECK --check-prefix CAPTURE
# RUN: rm %t.out
# RUN: %lldb --replay %t.repro | FileCheck %s --check-prefix CHECK --check-prefix REPLAY
@@ -7,7 +7,7 @@
# that the string "testing" is not printed.
# RUN: rm -rf %t.repro
# RUN: %clang %S/Inputs/simple.c -g -o %t.out
# RUN: %clang_host %S/Inputs/simple.c -g -o %t.out
# RUN: %lldb -x -b -s %S/Inputs/GDBRemoteCapture.in --capture --capture-path %t.repro %t.out | FileCheck %s --check-prefix CHECK --check-prefix CAPTURE
# RUN: env FOO=BAR %lldb --replay %t.repro | FileCheck %s --check-prefix CHECK --check-prefix REPLAY
@@ -3,6 +3,6 @@
# RUN: mkdir -p %t
# RUN: cd %t
# RUN: rm -rf ./foo
# RUN: %clang %S/Inputs/simple.c -g -o %t/reproducer.out
# RUN: %clang_host %S/Inputs/simple.c -g -o %t/reproducer.out
# RUN: %lldb -x -b -s %S/Inputs/FileCapture.in -o 'reproducer dump -p files' --capture --capture-path ./foo %t/reproducer.out
# RUN: %lldb --replay ./foo
@@ -4,7 +4,7 @@
# reproducer functionality.
# RUN: rm -rf %t.repro
# RUN: %clang %S/Inputs/simple.c -g -o %t.out
# RUN: %clang_host %S/Inputs/simple.c -g -o %t.out
# RUN: %lldb -x -b -s %S/Inputs/GDBRemoteCapture.in --capture --capture-path %t.repro %t.out | FileCheck %S/TestGDBRemoteRepro.test --check-prefix CHECK --check-prefix CAPTURE
# RUN: %lldb -x -b -s %S/Inputs/GDBRemoteCapture.in --capture --capture-path %t.repro %t.out | FileCheck %S/TestGDBRemoteRepro.test --check-prefix CHECK --check-prefix CAPTURE
# RUN: %lldb --replay %t.repro | FileCheck %S/TestGDBRemoteRepro.test --check-prefix CHECK --check-prefix REPLAY
@@ -11,7 +11,7 @@
# RUN: mkdir -p %t
# RUN: mkdir -p %t/binary
# RUN: cd %t
# RUN: %clang %S/Inputs/simple.c -g -o binary/reproducer.out
# RUN: %clang_host %S/Inputs/simple.c -g -o binary/reproducer.out
# RUN: %lldb -x -b -s %S/Inputs/WorkingDir.in --capture --capture-path %t.repro binary/reproducer.out
# RUN: rm -rf %t/binary
@@ -1,4 +1,4 @@
# RUN: %clang -g -O0 %S/Inputs/main.c -o %t.out
# RUN: %clang_host -g -O0 %S/Inputs/main.c -o %t.out
# RUN: %lldb -x -b -s %s %t.out | FileCheck %s
settings set use-color true
settings set -f frame-format "frame #${frame.index}: \`${ansi.fg.green}{${function.name-with-args}${ansi.normal}\n"
@@ -1,4 +1,4 @@
# RUN: %clang -g -O0 %S/Inputs/main.c -o %t.out
# RUN: %clang_host -g -O0 %S/Inputs/main.c -o %t.out
# RUN: %lldb -x -b -s %s %t.out | FileCheck %s
settings set use-color false
settings set -f frame-format "frame #${frame.index}: \`${ansi.fg.green}{${function.name-with-args}${ansi.normal}\n"
@@ -18,7 +18,7 @@
; } a;
;```
;
; RUN: %clang++ -g -c -o %t.o %s
; RUN: %clangxx_host -g -c -o %t.o %s
; RUN: lldb-test symbols -dump-clang-ast %t.o | FileCheck %s
; RUN: llvm-dwarfdump %t.o | FileCheck %s --check-prefix DWARFDUMP
@@ -3,7 +3,7 @@
// Test to verify we are corectly generating anonymous flags when parsing
// anonymous class and unnamed structs from DWARF to the a clang AST node.
// RUN: %clang++ -g -c -o %t.o %s
// RUN: %clangxx_host -g -c -o %t.o %s
// RUN: lldb-test symbols -dump-clang-ast %t.o | FileCheck %s
struct A {
@@ -1,22 +1,22 @@
# UNSUPPORTED: system-darwin, system-windows
# Make sure DWARF v4 type units work.
# RUN: %clangxx %S/Inputs/debug-types-expressions.cpp \
# RUN: %clangxx_host %S/Inputs/debug-types-expressions.cpp \
# RUN: -g -gdwarf-4 -fdebug-types-section -o %t4
# RUN: %lldb %t4 -s %s -o exit | FileCheck %s
# Now do the same for DWARF v5.
# RUN: %clangxx %S/Inputs/debug-types-expressions.cpp \
# RUN: %clangxx_host %S/Inputs/debug-types-expressions.cpp \
# RUN: -g -gdwarf-5 -fdebug-types-section -o %t5
# RUN: %lldb %t5 -s %s -o exit | FileCheck %s
# Test type units in dwo files.
# RUN: %clangxx %S/Inputs/debug-types-expressions.cpp \
# RUN: %clangxx_host %S/Inputs/debug-types-expressions.cpp \
# RUN: -g -gdwarf-4 -fdebug-types-section -o %t4dwo
# RUN: %lldb %t4dwo -s %s -o exit | FileCheck %s
# And type units+dwo+dwarf5.
# RUN: %clangxx %S/Inputs/debug-types-expressions.cpp \
# RUN: %clangxx_host %S/Inputs/debug-types-expressions.cpp \
# RUN: -g -gdwarf-5 -fdebug-types-section -o %t5dwo
# RUN: %lldb %t5dwo -s %s -o exit | FileCheck %s
@@ -2,8 +2,8 @@
// have their object files loaded by lldb. Note that the env var ZERO_AR_DATE
// requires the ld64 linker, which clang invokes by default.
// REQUIRES: system-darwin
// RUN: %clang %s -g -c -o %t.o
// RUN: ZERO_AR_DATE=1 %clang %t.o -g -o %t
// RUN: %clang_host %s -g -c -o %t.o
// RUN: ZERO_AR_DATE=1 %clang_host %t.o -g -o %t
// RUN: %lldb %t -o "breakpoint set -f %s -l 11" -o run -o exit | FileCheck %s
// CHECK: stop reason = breakpoint
@@ -1,5 +1,5 @@
REQUIRES: system-windows, lld
RUN: %clang_cl /c /Zi /Gy %S/Inputs/FunctionLevelLinkingTest.cpp /o %t.obj
RUN: %clang_cl_host /c /Zi /Gy %S/Inputs/FunctionLevelLinkingTest.cpp /o %t.obj
RUN: lld-link /debug:full /nodefaultlib /entry:main /order:@%S/Inputs/FunctionLevelLinkingTest.ord %t.obj /out:%t.exe
RUN: env LLDB_USE_NATIVE_PDB_READER=1 lldb-test symbols -verify %t.exe
RUN: env LLDB_USE_NATIVE_PDB_READER=0 lldb-test symbols -verify %t.exe
@@ -4,7 +4,7 @@
# UNSUPPORTED: system-windows, system-darwin
# RUN: cd %T
# RUN: %clang %S/Inputs/target-symbols-add-unwind.c -g \
# RUN: %clang_host %S/Inputs/target-symbols-add-unwind.c -g \
# RUN: -fno-unwind-tables -o target-symbols-add-unwind.debug
# RUN: llvm-objcopy --strip-debug target-symbols-add-unwind.debug \
# RUN: target-symbols-add-unwind.stripped
@@ -4,7 +4,7 @@
# UNSUPPORTED: system-windows
# REQUIRES: target-x86_64, native
# RUN: %clang %p/Inputs/call-asm.c %p/Inputs/eh-frame-dwarf-unwind.s -o %t
# RUN: %clang_host %p/Inputs/call-asm.c %p/Inputs/eh-frame-dwarf-unwind.s -o %t
# RUN: %lldb %t -s %s -o exit | FileCheck %s
breakpoint set -n bar
@@ -3,7 +3,7 @@
# REQUIRES: target-x86_64, system-linux, native
# RUN: %clang %p/Inputs/eh-frame-small-fde.s -o %t
# RUN: %clang_host %p/Inputs/eh-frame-small-fde.s -o %t
# RUN: %lldb %t -s %s -o exit | FileCheck %s
breakpoint set -n bar
@@ -8,7 +8,7 @@
# XFAIL: system-darwin
# REQUIRES: target-x86_64, native
# RUN: %clang -g %p/Inputs/call-asm.c %p/Inputs/prefer-debug-over-eh-frame.s -o %t
# RUN: %clang_host -g %p/Inputs/call-asm.c %p/Inputs/prefer-debug-over-eh-frame.s -o %t
# RUN: %lldb %t -s %s -o exit | FileCheck %s
breakpoint set -n bar
@@ -4,7 +4,7 @@
# UNSUPPORTED: system-windows
# REQUIRES: target-x86_64, native
# RUN: %clang %p/Inputs/call-asm.c %p/Inputs/trap_frame_sym_ctx.s -o %t
# RUN: %clang_host %p/Inputs/call-asm.c %p/Inputs/trap_frame_sym_ctx.s -o %t
# RUN: %lldb %t -s %s -o exit | FileCheck %s
settings append target.trap-handler-names tramp
@@ -1,6 +1,6 @@
# REQUIRES: target-x86_64, system-linux, native
# RUN: %clang %p/Inputs/unwind-plan-dwarf-dump.s -o %t
# RUN: %clang_host %p/Inputs/unwind-plan-dwarf-dump.s -o %t
# RUN: %lldb %t -s %s -o exit | FileCheck %s
breakpoint set -n main
@@ -1,4 +1,4 @@
# RUN: %clangxx %p/Inputs/main.cpp -g -o %t.out
# RUN: %clangxx_host %p/Inputs/main.cpp -g -o %t.out
# RUN: %lldb -b -o 'settings set interpreter.stop-command-source-on-error false' -s %s %t.out 2>&1 | FileCheck %s
settings show interpreter.stop-command-source-on-error
+12 -6
View File
@@ -85,7 +85,7 @@ def use_support_substitutions(config):
# Set up substitutions for support tools. These tools can be overridden at the CMake
# level (by specifying -DLLDB_LIT_TOOLS_DIR), installed, or as a last resort, we can use
# the just-built version.
flags = []
host_flags = ['--target=' + config.host_triple]
if platform.system() in ['Darwin']:
try:
out = subprocess.check_output(['xcrun', '--show-sdk-path']).strip()
@@ -95,26 +95,32 @@ def use_support_substitutions(config):
if res == 0 and out:
sdk_path = lit.util.to_string(out)
llvm_config.lit_config.note('using SDKROOT: %r' % sdk_path)
flags = ['-isysroot', sdk_path]
host_flags += ['-isysroot', sdk_path]
elif platform.system() in ['NetBSD', 'OpenBSD', 'Linux']:
flags = ['-pthread']
host_flags += ['-pthread']
if sys.platform.startswith('netbsd'):
# needed e.g. to use freshly built libc++
flags += ['-L' + config.llvm_libs_dir,
host_flags += ['-L' + config.llvm_libs_dir,
'-Wl,-rpath,' + config.llvm_libs_dir]
# The clang module cache is used for building inferiors.
flags += ['-fmodules-cache-path={}'.format(config.clang_module_cache)]
host_flags += ['-fmodules-cache-path={}'.format(config.clang_module_cache)]
host_flags = ' '.join(host_flags)
config.substitutions.append(('%clang_host', '%clang ' + host_flags))
config.substitutions.append(('%clangxx_host', '%clangxx ' + host_flags))
config.substitutions.append(('%clang_cl_host', '%clang_cl --target='+config.host_triple))
additional_tool_dirs=[]
if config.lldb_lit_tools_dir:
additional_tool_dirs.append(config.lldb_lit_tools_dir)
llvm_config.use_clang(additional_flags=flags,
llvm_config.use_clang(additional_flags=['--target=specify-a-target-or-use-a-_host-substitution'],
additional_tool_dirs=additional_tool_dirs,
required=True)
if sys.platform == 'win32':
_use_msvc_substitutions(config)