aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/testdata
diff options
context:
space:
mode:
authorTobias Bosch <tbosch@google.com>2019-10-01 15:00:52 -0700
committerTobias Bosch <tbosch@google.com>2019-10-02 16:53:48 +0000
commitc88ee8a1d2c3d925a90f7a880ae085237b117454 (patch)
treee1c35815b9b354ffebe485c077e17c22099b59e2 /compiler_wrapper/testdata
parent5322d4af4264a1e63fa33c732cdfb32454347a5c (diff)
downloadtoolchain-utils-c88ee8a1d2c3d925a90f7a880ae085237b117454.tar.gz
Android wrapper: Support compile with fallback.
The old android wrapper supports to use a fallback compiler in case of errors. This replicates this logic. See https://cs.corp.google.com/android/toolchain/llvm_android/compiler_wrapper.py. BUG=chromium:773875 TEST=unit test, golden tests comparing to old wrapper Change-Id: Iff7281e6e21c4834f9a4493884ed7b3d66b87967 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1833898 Tested-by: Tobias Bosch <tbosch@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'compiler_wrapper/testdata')
-rw-r--r--compiler_wrapper/testdata/android_golden/compile_with_fallback.json115
1 files changed, 115 insertions, 0 deletions
diff --git a/compiler_wrapper/testdata/android_golden/compile_with_fallback.json b/compiler_wrapper/testdata/android_golden/compile_with_fallback.json
new file mode 100644
index 00000000..509583ae
--- /dev/null
+++ b/compiler_wrapper/testdata/android_golden/compile_with_fallback.json
@@ -0,0 +1,115 @@
+[
+ {
+ "wd": "/tmp/stable",
+ "env": [
+ "ANDROID_LLVM_PREBUILT_COMPILER_PATH=fallback_compiler",
+ "ANDROID_LLVM_STDERR_REDIRECT=/tmp/stable/fallback_stderr",
+ "ANDROID_LLVM_FALLBACK_DISABLED_WARNINGS=-a -b"
+ ],
+ "wrapper": {
+ "cmd": {
+ "path": "/tmp/stable/clang",
+ "args": [
+ "main.cc"
+ ]
+ }
+ },
+ "cmds": [
+ {
+ "cmd": {
+ "path": "/tmp/stable/clang.real",
+ "args": [
+ "main.cc",
+ "-fno-color-diagnostics",
+ "-a",
+ "-b"
+ ]
+ }
+ }
+ ]
+ },
+ {
+ "wd": "/tmp/stable",
+ "env": [
+ "ANDROID_LLVM_PREBUILT_COMPILER_PATH=fallback_compiler",
+ "ANDROID_LLVM_STDERR_REDIRECT=/tmp/stable/fallback_stderr",
+ "ANDROID_LLVM_FALLBACK_DISABLED_WARNINGS=-a -b"
+ ],
+ "wrapper": {
+ "cmd": {
+ "path": "/tmp/stable/clang",
+ "args": [
+ "main.cc"
+ ]
+ }
+ },
+ "cmds": [
+ {
+ "cmd": {
+ "path": "/tmp/stable/clang.real",
+ "args": [
+ "main.cc",
+ "-fno-color-diagnostics",
+ "-a",
+ "-b"
+ ]
+ },
+ "exitcode": 1
+ },
+ {
+ "cmd": {
+ "path": "fallback_compiler/clang",
+ "args": [
+ "main.cc"
+ ],
+ "env_updates": [
+ "ANDROID_LLVM_PREBUILT_COMPILER_PATH="
+ ]
+ }
+ }
+ ]
+ },
+ {
+ "wd": "/tmp/stable",
+ "env": [
+ "ANDROID_LLVM_PREBUILT_COMPILER_PATH=fallback_compiler",
+ "ANDROID_LLVM_STDERR_REDIRECT=/tmp/stable/fallback_stderr",
+ "ANDROID_LLVM_FALLBACK_DISABLED_WARNINGS=-a -b"
+ ],
+ "wrapper": {
+ "cmd": {
+ "path": "/tmp/stable/clang",
+ "args": [
+ "main.cc"
+ ]
+ },
+ "exitcode": 1
+ },
+ "cmds": [
+ {
+ "cmd": {
+ "path": "/tmp/stable/clang.real",
+ "args": [
+ "main.cc",
+ "-fno-color-diagnostics",
+ "-a",
+ "-b"
+ ]
+ },
+ "exitcode": 1
+ },
+ {
+ "cmd": {
+ "path": "fallback_compiler/clang",
+ "args": [
+ "main.cc"
+ ],
+ "env_updates": [
+ "ANDROID_LLVM_PREBUILT_COMPILER_PATH="
+ ]
+ },
+ "exitcode": 1
+ }
+ ]
+ }
+]