r184383 - [libclang] Make sure crash-recovery for module-building does not interfere with libclang crash-recovery.

Argyrios Kyrtzidis akyrtzi at gmail.com
Wed Jun 19 16:15:35 PDT 2013


Author: akirtzidis
Date: Wed Jun 19 18:15:35 2013
New Revision: 184383

URL: http://llvm.org/viewvc/llvm-project?rev=184383&view=rev
Log:
[libclang] Make sure crash-recovery for module-building does not interfere with libclang crash-recovery.

This tests llvm commit r184380.
rdar://14204560

Modified:
    cfe/trunk/test/Index/crash-recovery-modules.m

Modified: cfe/trunk/test/Index/crash-recovery-modules.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/crash-recovery-modules.m?rev=184383&r1=184382&r2=184383&view=diff
==============================================================================
--- cfe/trunk/test/Index/crash-recovery-modules.m (original)
+++ cfe/trunk/test/Index/crash-recovery-modules.m Wed Jun 19 18:15:35 2013
@@ -15,6 +15,21 @@
 
 @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!





More information about the cfe-commits mailing list