summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-12-05 08:19:32 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-12-05 08:19:32 +0000
commit9ef5775a949d2c78ba01169d0eca962f5d7c1ae7 (patch)
treeb5449b4ac390544b73b20cb0b3864dab91a40150 /clang/test
parent011e6a5f44f7085279da2afde76f7041825b8b88 (diff)
downloadbcm5719-llvm-9ef5775a949d2c78ba01169d0eca962f5d7c1ae7.tar.gz
bcm5719-llvm-9ef5775a949d2c78ba01169d0eca962f5d7c1ae7.zip
[libclang] Record ranges skipped by the preprocessor and expose them with libclang.
Patch by Erik Verbruggen! llvm-svn: 196487
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Index/skipped-ranges.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/clang/test/Index/skipped-ranges.c b/clang/test/Index/skipped-ranges.c
new file mode 100644
index 00000000000..bd16fb3856b
--- /dev/null
+++ b/clang/test/Index/skipped-ranges.c
@@ -0,0 +1,25 @@
+#define cool
+
+#if defined(cool)
+
+#if defined(really_cool)
+#endif // really_cool
+
+#elif defined(hot)
+// hot
+
+
+#endif // trailing comment
+
+#ifndef cool
+#ifndef uncool
+
+int probably_hot = 1;
+
+#endif // uncool
+#endif // cool
+
+// RUN: env CINDEXTEST_SHOW_SKIPPED_RANGES=1 c-index-test -test-annotate-tokens=%s:1:1:16:1 %s | FileCheck %s
+// CHECK: Skipping: [5:2 - 6:7]
+// CHECK: Skipping: [8:2 - 12:7]
+// CHECK: Skipping: [14:2 - 20:7]
OpenPOWER on IntegriCloud