[cfe-commits] r144509 - /cfe/trunk/tools/c-index-test/c-index-test.c
Argyrios Kyrtzidis
akyrtzi at gmail.com
Sun Nov 13 14:08:33 PST 2011
Author: akirtzidis
Date: Sun Nov 13 16:08:33 2011
New Revision: 144509
URL: http://llvm.org/viewvc/llvm-project?rev=144509&view=rev
Log:
[libclang] for c-index-test, check for CINDEXTEST_FAILONERROR when doing -test-load-source-reparse
Modified:
cfe/trunk/tools/c-index-test/c-index-test.c
Modified: cfe/trunk/tools/c-index-test/c-index-test.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/c-index-test/c-index-test.c?rev=144509&r1=144508&r2=144509&view=diff
==============================================================================
--- cfe/trunk/tools/c-index-test/c-index-test.c (original)
+++ cfe/trunk/tools/c-index-test/c-index-test.c Sun Nov 13 16:08:33 2011
@@ -45,6 +45,8 @@
return options;
}
+static int checkForErrors(CXTranslationUnit TU);
+
static void PrintExtent(FILE *out, unsigned begin_line, unsigned begin_column,
unsigned end_line, unsigned end_column) {
fprintf(out, "[%d:%d - %d:%d]", begin_line, begin_column,
@@ -802,6 +804,9 @@
return 1;
}
+ if (checkForErrors(TU) != 0)
+ return -1;
+
if (getenv("CINDEXTEST_REMAP_AFTER_TRIAL")) {
remap_after_trial =
strtol(getenv("CINDEXTEST_REMAP_AFTER_TRIAL"), &endptr, 10);
@@ -818,9 +823,16 @@
clang_disposeIndex(Idx);
return -1;
}
+
+ if (checkForErrors(TU) != 0)
+ return -1;
}
result = perform_test_load(Idx, TU, filter, NULL, Visitor, PV);
+
+ if (checkForErrors(TU) != 0)
+ return -1;
+
free_remapped_files(unsaved_files, num_unsaved_files);
clang_disposeIndex(Idx);
return result;
More information about the cfe-commits
mailing list