summaryrefslogtreecommitdiffstats
path: root/clang/test/Index/complete-macros.c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-10-09 16:01:50 +0000
committerDouglas Gregor <dgregor@apple.com>2012-10-09 16:01:50 +0000
commit8cb174654fa508a759e11fda7b2ca8c15efe9cae (patch)
tree1ba673ed54f793b8fd441868733515bd4cbd4002 /clang/test/Index/complete-macros.c
parent97e5949068f77dbc0569c9bc9813d789ed4b299b (diff)
downloadbcm5719-llvm-8cb174654fa508a759e11fda7b2ca8c15efe9cae.tar.gz
bcm5719-llvm-8cb174654fa508a759e11fda7b2ca8c15efe9cae.zip
If a macro has been #undef'd in a precompiled header, we still need to
write out the macro history for that macro. Similarly, we need to cope with reading a macro definition that has been #undef'd. Take advantage of this new ability so that global code-completion results can refer to #undef'd macros, rather than losing them entirely. For multiply defined/#undef'd macros, we will still get the wrong result, but it's better than getting no result. llvm-svn: 165502
Diffstat (limited to 'clang/test/Index/complete-macros.c')
-rw-r--r--clang/test/Index/complete-macros.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/test/Index/complete-macros.c b/clang/test/Index/complete-macros.c
index df798a8477f..6d27b449ae2 100644
--- a/clang/test/Index/complete-macros.c
+++ b/clang/test/Index/complete-macros.c
@@ -1,8 +1,8 @@
// Note: the run lines follow their respective tests, since line/column
// matter in this test.
-
#define FOO(Arg1,Arg2) foobar
#define nil 0
+#undef FOO
void f() {
}
@@ -25,7 +25,8 @@ void test_variadic() {
}
-// RUN: c-index-test -code-completion-at=%s:7:1 %s | FileCheck -check-prefix=CHECK-CC1 %s
+// RUN: c-index-test -code-completion-at=%s:7:1 %s | FileCheck -check-prefix=CHECK-CC0 %s
+// CHECK-CC0-NOT: FOO
// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:7:1 %s | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: macro definition:{TypedText FOO}{LeftParen (}{Placeholder Arg1}{Comma , }{Placeholder Arg2}{RightParen )}
// RUN: c-index-test -code-completion-at=%s:13:13 %s | FileCheck -check-prefix=CHECK-CC2 %s
OpenPOWER on IntegriCloud