1 | // RUN: rm -rf %t |
2 | // RUN: mkdir %t |
3 | // RUN: env TMPDIR=%t TEMP=%t TMP=%t RC_DEBUG_OPTIONS=1 \ |
4 | // RUN: CC_PRINT_HEADERS=1 CC_LOG_DIAGNOSTICS=1 \ |
5 | // RUN: not %clang -fsyntax-only %s \ |
6 | // RUN: -F/tmp/ -I /tmp/ -idirafter /tmp/ -iquote /tmp/ -isystem /tmp/ \ |
7 | // RUN: -iprefix /the/prefix -iwithprefix /tmp -iwithprefixbefore /tmp/ \ |
8 | // RUN: -Xclang -internal-isystem -Xclang /tmp/ \ |
9 | // RUN: -Xclang -internal-externc-isystem -Xclang /tmp/ \ |
10 | // RUN: -Xclang -main-file-name -Xclang foo.c \ |
11 | // RUN: -DFOO=BAR -DBAR="BAZ QUX" 2>&1 | FileCheck %s |
12 | // RUN: cat %t/crash-report-*.c | FileCheck --check-prefix=CHECKSRC %s |
13 | // RUN: cat %t/crash-report-*.sh | FileCheck --check-prefix=CHECKSH %s |
14 | // REQUIRES: crash-recovery |
15 | |
16 | #pragma clang __debug parser_crash |
17 | // CHECK: Preprocessed source(s) and associated run script(s) are located at: |
18 | // CHECK-NEXT: note: diagnostic msg: {{.*}}crash-report-{{.*}}.c |
19 | FOO |
20 | // CHECKSRC: FOO |
21 | // CHECKSH: # Crash reproducer |
22 | // CHECKSH-NEXT: # Driver args: "-fsyntax-only" |
23 | // CHECKSH-SAME: "-D" "FOO=BAR" |
24 | // CHECKSH-SAME: "-D" "BAR=BAZ QUX" |
25 | // CHECKSH-NEXT: # Original command: {{.*$}} |
26 | // CHECKSH-NEXT: "-cc1" |
27 | // CHECKSH: "-main-file-name" "crash-report.c" |
28 | // CHECKSH-NOT: "-header-include-file" |
29 | // CHECKSH-NOT: "-diagnostic-log-file" |
30 | // CHECKSH: "-D" "FOO=BAR" |
31 | // CHECKSH: "-D" "BAR=BAZ QUX" |
32 | // CHECKSH-NOT: "-F/tmp/" |
33 | // CHECKSH-NOT: "-I" "/tmp/" |
34 | // CHECKSH-NOT: "-idirafter" "/tmp/" |
35 | // CHECKSH-NOT: "-iquote" "/tmp/" |
36 | // CHECKSH-NOT: "-isystem" "/tmp/" |
37 | // CHECKSH-NOT: "-iprefix" "/the/prefix" |
38 | // CHECKSH-NOT: "-iwithprefix" "/tmp/" |
39 | // CHECKSH-NOT: "-iwithprefixbefore" "/tmp/" |
40 | // CHECKSH-NOT: "-internal-isystem" "/tmp/" |
41 | // CHECKSH-NOT: "-internal-externc-isystem" "/tmp/" |
42 | // CHECKSH-NOT: "-dwarf-debug-flags" |
43 | // CHECKSH: "crash-report-{{[^ ]*}}.c" |
44 | |