aboutsummaryrefslogtreecommitdiff
path: root/test/Index/complete-in-stringify.c
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-09-04 03:32:19 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-09-04 03:32:19 +0000
commit8e85e85b8c3dbbc7e9863fe88f0992d825fd0e32 (patch)
tree6a9096326c64f46ac25c297b802f9e782a858874 /test/Index/complete-in-stringify.c
parent7d100872341f233c81e1d7b72b40457e62c36862 (diff)
Handle a code-completion token being passed to the macro stringify operator.
Fixes http://llvm.org/PR10826. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139087 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index/complete-in-stringify.c')
-rw-r--r--test/Index/complete-in-stringify.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Index/complete-in-stringify.c b/test/Index/complete-in-stringify.c
new file mode 100644
index 0000000000..d5185496f8
--- /dev/null
+++ b/test/Index/complete-in-stringify.c
@@ -0,0 +1,17 @@
+const char *func(const char *);
+
+#define MORE __FILE__
+
+#define M(x) "1"#x
+#define N(x) func("2"#x MORE)
+
+void foo(const char *);
+
+int test() {
+ foo(M(x()));
+ foo(N(x()));
+}
+
+// RUN: c-index-test -code-completion-at=%s:11:11 %s | FileCheck %s
+// RUN: c-index-test -code-completion-at=%s:12:11 %s | FileCheck %s
+// CHECK: Natural language