Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Driver / crash-report-clang-cl.cpp
blob963c3b6d0ab0330047fb3ac94b235b70ecc1c276
1 // RUN: export LSAN_OPTIONS=detect_leaks=0
2 // RUN: rm -rf %t
3 // RUN: mkdir %t
5 // RUN: not %clang_cl -fsyntax-only /Brepro /source-charset:utf-8 \
6 // RUN: -fcrash-diagnostics-dir=%t -- %s 2>&1 | FileCheck %s
7 // RUN: cat %t/crash-report-clang-cl-*.cpp | FileCheck --check-prefix=CHECKSRC %s
8 // RUN: cat %t/crash-report-clang-cl-*.sh | FileCheck --check-prefix=CHECKSH %s
10 // REQUIRES: crash-recovery
12 #pragma clang __debug crash
14 // CHECK: Preprocessed source(s) and associated run script(s) are located at:
16 // __has_feature(cxx_exceptions) is default-off in the cl-compatible driver.
17 FOO
18 #if __has_feature(cxx_exceptions)
19 int a = 1;
20 #else
21 int a = 0;
22 #endif
23 // CHECKSRC: {{^}}FOO
24 // CHECKSRC-NEXT: {{^}}#if 0 /* disabled by -frewrite-includes */
25 // CHECKSRC-NEXT: {{^}}#if __has_feature(cxx_exceptions)
26 // CHECKSRC-NEXT: {{^}}#endif
27 // CHECKSRC-NEXT: {{^}}#endif /* disabled by -frewrite-includes */
28 // CHECKSRC-NEXT: {{^}}#if 0 /* evaluated by -frewrite-includes */
29 // CHECKSRC-NEXT: {{^}}#
30 // CHECKSRC-NEXT: {{^}}int a = 1;
31 // CHECKSRC-NEXT: {{^}}#else
32 // CHECKSRC-NEXT: {{^}}#
33 // CHECKSRC-NEXT: {{^}}int a = 0;
34 // CHECKSRC-NEXT: {{^}}#endif
36 // CHECK-NEXT: note: diagnostic msg: {{.*}}crash-report-clang-cl-{{.*}}.cpp
37 // CHECKSH: # Crash reproducer
38 // CHECKSH-NEXT: # Driver args: {{.*}}"-fsyntax-only"
39 // CHECKSH-SAME: /Brepro
40 // CHECKSH-SAME: /source-charset:utf-8
41 // CHECKSH-NOT: -mno-incremental-linker-compatible
42 // CHECKSH-NOT: -finput-charset=utf-8
43 // CHECKSH-NEXT: # Original command: {{.*$}}
44 // CHECKSH-NEXT: "-cc1"
45 // CHECKSH: "-main-file-name" "crash-report-clang-cl.cpp"
46 // CHECKSH: "crash-report-{{[^ ]*}}.cpp"