summaryrefslogtreecommitdiff
path: root/test/CodeCompletion/macros.c
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2009-11-04 15:04:32 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2009-11-04 15:04:32 +0000
commit51fb8b013e7734b795139f49d3b1f77c539be20a (patch)
tree59e0e47a9831dcf0e21e547927c8ebb7e113bfd1 /test/CodeCompletion/macros.c
parent73490b890977362d28dd6326843a1ecae413921d (diff)
Diffstat (limited to 'test/CodeCompletion/macros.c')
-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 0000000000000..d5c1f8f17fce6
--- /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
+}