blob: 8d93c1ae06d2409e102ffe2dc77716f25cce0296 [file] [log] [blame]
Douglas Gregor85ae12d2012-01-29 19:57:03 +00001// Clear out the module cache entirely, so we start from nothing.
2// RUN: rm -rf %t
3
4// Parse the file, such that building the module will cause Clang to crash.
5// RUN: not env CINDEXTEST_FAILONERROR=1 c-index-test -test-load-source all -fmodules -fmodule-cache-path %t -Xclang -fdisable-module-hash -I %S/Inputs/Headers -DCRASH %s 2> %t.err
6// RUN: FileCheck < %t.err -check-prefix=CHECK-CRASH %s
Douglas Gregor1b257af2012-12-11 22:11:52 +00007// CHECK-CRASH: crash-recovery-modules.m:16:9:{16:2-16:14}: fatal error: could not build module 'Crash'
Douglas Gregor85ae12d2012-01-29 19:57:03 +00008
9// Parse the file again, without crashing, to make sure that
10// subsequent parses do the right thing.
11// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -test-load-source all -fmodules -fmodule-cache-path %t -Xclang -fdisable-module-hash -I %S/Inputs/Headers %s
12
13// REQUIRES: crash-recovery
Douglas Gregora0074312012-01-29 20:04:46 +000014// REQUIRES: shell
Douglas Gregor85ae12d2012-01-29 19:57:03 +000015
Douglas Gregor1b257af2012-12-11 22:11:52 +000016@import Crash;
Douglas Gregor85ae12d2012-01-29 19:57:03 +000017
18void test() {
19 const char* error = getCrashString();
20}