1// FIXME: Instead of %T/crmdir, it would be nice to just use %t, but the
2// filename ran into path length limits for the rm command on some Windows
3// bots.
4// RUN: rm -rf %T/crmdir
5// RUN: mkdir -p %T/crmdir/i %T/crmdir/m
6
7// RUN: env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%T/crmdir TEMP=%T/crmdir TMP=%T/crmdir \
8// RUN: not %clang -fsyntax-only %s -I %S/Inputs/module -isysroot %/t/i/                 \
9// RUN: -fmodules -fmodules-cache-path=%T/crmdir/m/ -DFOO=BAR 2>&1 | FileCheck %s
10
11// RUN: FileCheck --check-prefix=CHECKSRC %s -input-file %T/crmdir/crash-report-*.m
12// RUN: FileCheck --check-prefix=CHECKSH %s -input-file %T/crmdir/crash-report-*.sh
13// REQUIRES: crash-recovery
14
15// FIXME: This test creates excessively deep directory hierarchies that cause
16// problems on Windows.
17// UNSUPPORTED: system-windows
18
19@import simple;
20const int x = MODULE_MACRO;
21
22// CHECK: PLEASE submit a bug report to {{.*}} and include the crash backtrace, preprocessed source, and associated run script.
23// CHECK: Preprocessed source(s) and associated run script(s) are located at:
24// CHECK-NEXT: note: diagnostic msg: {{.*}}.m
25// CHECK-NEXT: note: diagnostic msg: {{.*}}.cache
26
27// CHECKSRC: @import simple;
28// CHECKSRC: const int x = 10;
29
30// CHECKSH: # Crash reproducer
31// CHECKSH-NEXT: # Driver args: "-fsyntax-only"
32// CHECKSH-SAME: "-D" "FOO=BAR"
33// CHECKSH-NEXT: # Original command: {{.*$}}
34// CHECKSH-NEXT: "-cc1"
35// CHECKSH: "-isysroot" "{{[^"]*}}/i/"
36// CHECKSH: "-D" "FOO=BAR"
37// CHECKSH-NOT: "-fmodules-cache-path="
38// CHECKSH: "crash-report-modules-{{[^ ]*}}.m"
39// CHECKSH: "-ivfsoverlay" "crash-report-modules-{{[^ ]*}}.cache{{(/|\\\\)}}vfs{{(/|\\\\)}}vfs.yaml"
40