summaryrefslogtreecommitdiffstats
path: root/test/CodeCompletion
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-10-30 16:50:04 +0000
committerDouglas Gregor <dgregor@apple.com>2009-10-30 16:50:04 +0000
commit3f7c7f48654230d8e379214cfe49fcf2fde0a2c6 (patch)
tree20ef857f30df975a8366bbf224e74446fed9cb94 /test/CodeCompletion
parent31abe8ce8576a209e8df80ea615f207c5a108aaa (diff)
Include macros in code-completion results
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85594 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeCompletion')
-rw-r--r--test/CodeCompletion/macros.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/CodeCompletion/macros.c b/test/CodeCompletion/macros.c
new file mode 100644
index 0000000000..d5c1f8f17f
--- /dev/null
+++ b/test/CodeCompletion/macros.c
@@ -0,0 +1,37 @@
+#define FOO
+#define BAR(X, Y) X, Y
+#define IDENTITY(X) X
+#define WIBBLE(...)
+
+enum Color {
+ Red, Green, Blue
+};
+
+struct Point {
+ float x, y, z;
+ enum Color color;
+};
+
+void test(struct Point *p) {
+ // RUN: clang-cc -fsyntax-only -code-completion-at=%s:17:14 %s -o - | FileCheck -check-prefix=CC1 %s &&
+ switch (p->IDENTITY(color)) {
+ // RUN: clang-cc -fsyntax-only -code-completion-at=%s:19:9 %s -o - | FileCheck -check-prefix=CC2 %s &&
+ case
+ }
+ // CC1: color
+ // CC1: x
+ // CC1: y
+ // CC1: z
+ // CC1: BAR(<#X#>, <#Y#>)
+ // CC1: FOO
+ // CC1: IDENTITY(<#X#>)
+ // CC1: WIBBLE
+ // CC2: Blue
+ // CC2: Green
+ // CC2: Red
+ // CC2: BAR(<#X#>, <#Y#>)
+ // CC2: FOO
+ // CC2: IDENTITY(<#X#>)
+ // CC2: WIBBLE
+ // RUN: true
+}