Clang Project

clang_source_code/test/Driver/crash-report-modules.m
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: Preprocessed source(s) and associated run script(s) are located at:
23// CHECK-NEXT: note: diagnostic msg: {{.*}}.m
24// CHECK-NEXT: note: diagnostic msg: {{.*}}.cache
25
26// CHECKSRC: @import simple;
27// CHECKSRC: const int x = 10;
28
29// CHECKSH: # Crash reproducer
30// CHECKSH-NEXT: # Driver args: "-fsyntax-only"
31// CHECKSH-SAME: "-D" "FOO=BAR"
32// CHECKSH-NEXT: # Original command: {{.*$}}
33// CHECKSH-NEXT: "-cc1"
34// CHECKSH: "-isysroot" "{{[^"]*}}/i/"
35// CHECKSH: "-D" "FOO=BAR"
36// CHECKSH-NOT: "-fmodules-cache-path="
37// CHECKSH: "crash-report-modules-{{[^ ]*}}.m"
38// CHECKSH: "-ivfsoverlay" "crash-report-modules-{{[^ ]*}}.cache{{(/|\\\\)}}vfs{{(/|\\\\)}}vfs.yaml"
39