summaryrefslogtreecommitdiff
path: root/clang/test/Index/annotate-macro-args.m
diff options
context:
space:
mode:
authorCarlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au>2012-10-15 17:10:06 +1100
committerCarlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au>2012-10-15 17:10:06 +1100
commitbe1de4be954c80875ad4108e0a33e8e131b2f2c0 (patch)
tree1fbbecf276bf7c7bdcbb4dd446099d6d90eaa516 /clang/test/Index/annotate-macro-args.m
parentc4626a62754862d20b41e8a46a3574264ea80e6d (diff)
parentf1bd2e48c5324d3f7cda4090c87f8a5b6f463ce2 (diff)
Merge branch 'master' of ssh://bitbucket.org/czan/honours
Diffstat (limited to 'clang/test/Index/annotate-macro-args.m')
-rw-r--r--clang/test/Index/annotate-macro-args.m23
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/test/Index/annotate-macro-args.m b/clang/test/Index/annotate-macro-args.m
new file mode 100644
index 0000000..b92c0b2
--- /dev/null
+++ b/clang/test/Index/annotate-macro-args.m
@@ -0,0 +1,23 @@
+// Test without PCH
+// RUN: c-index-test -test-annotate-tokens=%S/annotate-macro-args.h:9:1:10:1 %s -include annotate-macro-args.h | FileCheck -check-prefix=CHECK1 %s
+// RUN: c-index-test -test-annotate-tokens=%S/annotate-macro-args.h:15:1:16:1 %s -include annotate-macro-args.h | FileCheck -check-prefix=CHECK2 %s
+
+// Test with PCH
+// RUN: c-index-test -write-pch %t.pch -x objective-c-header %S/annotate-macro-args.h -Xclang -detailed-preprocessing-record
+// RUN: c-index-test -test-annotate-tokens=%S/annotate-macro-args.h:9:1:10:1 %s -include-pch %t.pch | FileCheck -check-prefix=CHECK1 %s
+// RUN: c-index-test -test-annotate-tokens=%S/annotate-macro-args.h:15:1:16:1 %s -include-pch %t.pch | FileCheck -check-prefix=CHECK2 %s
+
+// CHECK1: Identifier: "MACRO" [9:3 - 9:8] macro expansion=MACRO:6:9
+// CHECK1: Punctuation: "(" [9:8 - 9:9]
+// CHECK1: Punctuation: "[" [9:9 - 9:10] ObjCMessageExpr=meth:2:8
+// CHECK1: Identifier: "MyClass" [9:10 - 9:17] ObjCClassRef=MyClass:1:12
+// CHECK1: Identifier: "meth" [9:18 - 9:22] ObjCMessageExpr=meth:2:8
+// CHECK1: Punctuation: "]" [9:22 - 9:23] ObjCMessageExpr=meth:2:8
+// CHECK1: Punctuation: ")" [9:23 - 9:24]
+
+// CHECK2: Identifier: "INVOKE" [15:3 - 15:9] macro expansion=INVOKE:12:9
+// CHECK2: Punctuation: "(" [15:9 - 15:10]
+// CHECK2: Identifier: "meth" [15:10 - 15:14] ObjCMessageExpr=meth:2:8
+// CHECK2: Punctuation: "," [15:14 - 15:15]
+// CHECK2: Identifier: "MyClass" [15:16 - 15:23] ObjCClassRef=MyClass:1:12
+// CHECK2: Punctuation: ")" [15:23 - 15:24]