summaryrefslogtreecommitdiffstats
path: root/lldb/test/Shell/SymbolFile
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-10-30 15:57:16 +0100
committerPavel Labath <pavel@labath.sk>2019-10-31 10:40:37 +0100
commit9c739252261ea762d1bbbd8234d93c9038711fcd (patch)
tree67566285d8632debaecf25dbc79a24ff01555413 /lldb/test/Shell/SymbolFile
parenta7aee6c47a1b12dd7d579b4f98d7049eb1e987ce (diff)
downloadbcm5719-llvm-9c739252261ea762d1bbbd8234d93c9038711fcd.tar.gz
bcm5719-llvm-9c739252261ea762d1bbbd8234d93c9038711fcd.zip
[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
Diffstat (limited to 'lldb/test/Shell/SymbolFile')
-rw-r--r--lldb/test/Shell/SymbolFile/DWARF/anon_class_w_and_wo_export_symbols.ll2
-rw-r--r--lldb/test/Shell/SymbolFile/DWARF/clang-ast-from-dwarf-unamed-and-anon-structs.cpp2
-rw-r--r--lldb/test/Shell/SymbolFile/DWARF/debug-types-expressions.test8
-rw-r--r--lldb/test/Shell/SymbolFile/DWARF/deterministic-build.cpp4
-rw-r--r--lldb/test/Shell/SymbolFile/PDB/function-level-linking.test2
-rw-r--r--lldb/test/Shell/SymbolFile/target-symbols-add-unwind.test2
6 files changed, 10 insertions, 10 deletions
diff --git a/lldb/test/Shell/SymbolFile/DWARF/anon_class_w_and_wo_export_symbols.ll b/lldb/test/Shell/SymbolFile/DWARF/anon_class_w_and_wo_export_symbols.ll
index aab0128264c..40a8ac037c2 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/anon_class_w_and_wo_export_symbols.ll
+++ b/lldb/test/Shell/SymbolFile/DWARF/anon_class_w_and_wo_export_symbols.ll
@@ -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
diff --git a/lldb/test/Shell/SymbolFile/DWARF/clang-ast-from-dwarf-unamed-and-anon-structs.cpp b/lldb/test/Shell/SymbolFile/DWARF/clang-ast-from-dwarf-unamed-and-anon-structs.cpp
index 5e80c5c6d0b..575ae4fdc9f 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/clang-ast-from-dwarf-unamed-and-anon-structs.cpp
+++ b/lldb/test/Shell/SymbolFile/DWARF/clang-ast-from-dwarf-unamed-and-anon-structs.cpp
@@ -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 {
diff --git a/lldb/test/Shell/SymbolFile/DWARF/debug-types-expressions.test b/lldb/test/Shell/SymbolFile/DWARF/debug-types-expressions.test
index 6da06d7b74f..5964eea40ad 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/debug-types-expressions.test
+++ b/lldb/test/Shell/SymbolFile/DWARF/debug-types-expressions.test
@@ -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
diff --git a/lldb/test/Shell/SymbolFile/DWARF/deterministic-build.cpp b/lldb/test/Shell/SymbolFile/DWARF/deterministic-build.cpp
index 576c4ab7244..9e79f23db2b 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/deterministic-build.cpp
+++ b/lldb/test/Shell/SymbolFile/DWARF/deterministic-build.cpp
@@ -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
diff --git a/lldb/test/Shell/SymbolFile/PDB/function-level-linking.test b/lldb/test/Shell/SymbolFile/PDB/function-level-linking.test
index 37b2cbc761b..ec0ef574400 100644
--- a/lldb/test/Shell/SymbolFile/PDB/function-level-linking.test
+++ b/lldb/test/Shell/SymbolFile/PDB/function-level-linking.test
@@ -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
diff --git a/lldb/test/Shell/SymbolFile/target-symbols-add-unwind.test b/lldb/test/Shell/SymbolFile/target-symbols-add-unwind.test
index c6542134fcf..b4f0cc4c402 100644
--- a/lldb/test/Shell/SymbolFile/target-symbols-add-unwind.test
+++ b/lldb/test/Shell/SymbolFile/target-symbols-add-unwind.test
@@ -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
OpenPOWER on IntegriCloud