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