1 | // REQUIRES: crash-recovery, shell, system-darwin |
2 | // RUN: rm -rf %t |
3 | // RUN: mkdir -p %t/i %t/m %t |
4 | |
5 | // RUN: not env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \ |
6 | // RUN: %clang -fsyntax-only %s \ |
7 | // RUN: -I %S/Inputs/module -isysroot %/t/i/ \ |
8 | // RUN: -fmodules -fmodules-cache-path=%t/m/ -DFOO=BAR 2>&1 | \ |
9 | // RUN: FileCheck -check-prefix=CRASH_ENV %s |
10 | |
11 | // RUN: not env TMPDIR=%t TEMP=%t TMP=%t \ |
12 | // RUN: %clang -gen-reproducer -fsyntax-only %s \ |
13 | // RUN: -I %S/Inputs/module -isysroot %/t/i/ \ |
14 | // RUN: -fmodules -fmodules-cache-path=%t/m/ -DFOO=BAR 2>&1 | \ |
15 | // RUN: FileCheck -check-prefix=CRASH_FLAG %s |
16 | |
17 | @import simple; |
18 | const int x = MODULE_MACRO; |
19 | |
20 | // CRASH_ENV: failing because environment variable 'FORCE_CLANG_DIAGNOSTICS_CRASH' is set |
21 | // CRASH_ENV: Preprocessed source(s) and associated run script(s) are located at: |
22 | // CRASH_ENV-NEXT: note: diagnostic msg: {{.*}}.m |
23 | // CRASH_ENV-NEXT: note: diagnostic msg: {{.*}}.cache |
24 | // CRASH_ENV-NEXT: note: diagnostic msg: {{.*}}.sh |
25 | // CRASH_ENV-NEXT: note: diagnostic msg: Crash backtrace is located in |
26 | // CRASH_ENV-NEXT: note: diagnostic msg: {{.*}}Library/Logs/DiagnosticReports{{.*}} |
27 | |
28 | // CRASH_FLAG: failing because '-gen-reproducer' is used |
29 | // CRASH_FLAG: Preprocessed source(s) and associated run script(s) are located at: |
30 | // CRASH_FLAG-NEXT: note: diagnostic msg: {{.*}}.m |
31 | // CRASH_FLAG-NEXT: note: diagnostic msg: {{.*}}.cache |
32 | // CRASH_FLAG-NEXT: note: diagnostic msg: {{.*}}.sh |
33 | // CRASH_FLAG-NEXT: note: diagnostic msg: Crash backtrace is located in |
34 | // CRASH_FLAG-NEXT: note: diagnostic msg: {{.*}}Library/Logs/DiagnosticReports{{.*}} |
35 | |