summaryrefslogtreecommitdiffstats
path: root/test/Index/preamble-cyclic-include.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Index/preamble-cyclic-include.cpp')
-rw-r--r--test/Index/preamble-cyclic-include.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Index/preamble-cyclic-include.cpp b/test/Index/preamble-cyclic-include.cpp
new file mode 100644
index 0000000000..cb057f62d5
--- /dev/null
+++ b/test/Index/preamble-cyclic-include.cpp
@@ -0,0 +1,9 @@
+// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-annotate-tokens=%s:5:1:10:1 %s 2>&1 | FileCheck %s
+// CHECK-NOT: error: unterminated conditional directive
+// CHECK-NOT: Skipping: [4:1 - 8:7]
+// CHECK: error: main file cannot be included recursively when building a preamble
+#ifndef A_H
+#define A_H
+# include "preamble-cyclic-include.cpp"
+int bar();
+#endif