]> granicus.if.org Git - clang/commitdiff
[libclang] Make sure crash-recovery for module-building does not interfere with libcl...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 19 Jun 2013 23:15:35 +0000 (23:15 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 19 Jun 2013 23:15:35 +0000 (23:15 +0000)
This tests llvm commit r184380.
rdar://14204560

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184383 91177308-0d34-0410-b5e6-96231b3b80d8

test/Index/crash-recovery-modules.m

index 23740ec98b3fc4f3fc8b705107911d86bf2f3658..431c23f7dcadbb76e1d3adddc494f878cee9af75 100644 (file)
 
 @import Crash;
 
+#ifdef LIBCLANG_CRASH
+#pragma clang __debug crash
+#endif
+
 void test() {
   const char* error = getCrashString();
 }
+
+
+// RUN: rm -rf %t
+// Check that libclang crash-recovery works; both with a module building crash...
+// RUN: not env CINDEXTEST_FAILONERROR=1 c-index-test -test-load-source all -fmodules -fmodules-cache-path=%t -Xclang -fdisable-module-hash -I %S/Inputs/Headers -DCRASH -DLIBCLANG_CRASH %s 2> %t.err
+// RUN: FileCheck < %t.err -check-prefix=CHECK-LIBCLANG-CRASH %s
+// ...and with module building successful.
+// RUN: not env CINDEXTEST_FAILONERROR=1 c-index-test -test-load-source all -fmodules -fmodules-cache-path=%t -Xclang -fdisable-module-hash -I %S/Inputs/Headers -DLIBCLANG_CRASH %s 2> %t.err
+// RUN: FileCheck < %t.err -check-prefix=CHECK-LIBCLANG-CRASH %s
+// CHECK-LIBCLANG-CRASH: libclang: crash detected during parsing
+// CHECK-LIBCLANG-CRASH: Unable to load translation unit!