aboutsummaryrefslogtreecommitdiff
path: root/test/CodeCompletion/macros.c
diff options
context:
space:
mode:
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 000000000000..d5c1f8f17fce
--- /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
+}