]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Driver/crash-report.c
Vendor import of clang trunk r242221:
[FreeBSD/FreeBSD.git] / test / Driver / crash-report.c
1 // RUN: rm -rf %t
2 // RUN: mkdir %t
3 // RUN: not env TMPDIR=%t TEMP=%t TMP=%t RC_DEBUG_OPTIONS=1 %clang -fsyntax-only %s \
4 // RUN:  -F/tmp/ -I /tmp/ -idirafter /tmp/ -iquote /tmp/ -isystem /tmp/ \
5 // RUN:  -iprefix /the/prefix -iwithprefix /tmp -iwithprefixbefore /tmp/ \
6 // RUN:  -Xclang -internal-isystem -Xclang /tmp/                         \
7 // RUN:  -Xclang -internal-externc-isystem -Xclang /tmp/                 \
8 // RUN:  -DFOO=BAR -DBAR="BAZ QUX" 2>&1 | FileCheck %s
9 // RUN: cat %t/crash-report-*.c | FileCheck --check-prefix=CHECKSRC %s
10 // RUN: cat %t/crash-report-*.sh | FileCheck --check-prefix=CHECKSH %s
11 // REQUIRES: crash-recovery
12
13 // because of the glob (*.c, *.sh)
14 // REQUIRES: shell
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: "-D" "FOO=BAR"
29 // CHECKSH: "-D" "BAR=BAZ QUX"
30 // CHECKSH-NOT: "-F/tmp/"
31 // CHECKSH-NOT: "-I" "/tmp/"
32 // CHECKSH-NOT: "-idirafter" "/tmp/"
33 // CHECKSH-NOT: "-iquote" "/tmp/"
34 // CHECKSH-NOT: "-isystem" "/tmp/"
35 // CHECKSH-NOT: "-iprefix" "/the/prefix"
36 // CHECKSH-NOT: "-iwithprefix" "/tmp/"
37 // CHECKSH-NOT: "-iwithprefixbefore" "/tmp/"
38 // CHECKSH-NOT: "-internal-isystem" "/tmp/"
39 // CHECKSH-NOT: "-internal-externc-isystem" "/tmp/"
40 // CHECKSH-NOT: "-dwarf-debug-flags"
41 // CHECKSH: "crash-report-{{[^ ]*}}.c"