Douglas Gregor | 85ae12d | 2012-01-29 19:57:03 +0000 | [diff] [blame] | 1 | // 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 Gregor | 1b257af | 2012-12-11 22:11:52 +0000 | [diff] [blame] | 7 | // CHECK-CRASH: crash-recovery-modules.m:16:9:{16:2-16:14}: fatal error: could not build module 'Crash' |
Douglas Gregor | 85ae12d | 2012-01-29 19:57:03 +0000 | [diff] [blame] | 8 | |
| 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 Gregor | a007431 | 2012-01-29 20:04:46 +0000 | [diff] [blame] | 14 | // REQUIRES: shell |
Douglas Gregor | 85ae12d | 2012-01-29 19:57:03 +0000 | [diff] [blame] | 15 | |
Douglas Gregor | 1b257af | 2012-12-11 22:11:52 +0000 | [diff] [blame] | 16 | @import Crash; |
Douglas Gregor | 85ae12d | 2012-01-29 19:57:03 +0000 | [diff] [blame] | 17 | |
| 18 | void test() { |
| 19 | const char* error = getCrashString(); |
| 20 | } |