summaryrefslogtreecommitdiff
path: root/clang/test/Rewriter/rewrite-message-expr.mm
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Rewriter/rewrite-message-expr.mm')
-rw-r--r--clang/test/Rewriter/rewrite-message-expr.mm25
1 files changed, 25 insertions, 0 deletions
diff --git a/clang/test/Rewriter/rewrite-message-expr.mm b/clang/test/Rewriter/rewrite-message-expr.mm
new file mode 100644
index 0000000..dafb31b
--- /dev/null
+++ b/clang/test/Rewriter/rewrite-message-expr.mm
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc -fobjc-fragile-abi %s -o %t-rw.cpp
+// RUN: FileCheck -check-prefix LP --input-file=%t-rw.cpp %s
+// radar 7617047
+
+@interface Baz
+- (id)y;
++ (id)z;
+@end
+
+@interface Foo {
+@public
+ int bar;
+}
+@end
+
+extern Foo* x(id a);
+
+int f(Baz *baz) {
+ int i = x([Baz z])->bar;
+ int j = ((Foo*)[Baz z])->bar;
+ int k = x([baz y])->bar;
+ return i+j+k;
+}
+
+// CHECK-LP: ((struct Foo_IMPL *)x(((id (*)(id, SEL))(void *)objc_msgSend)(objc_getClass("Baz"), sel_registerName("z"))))->bar