xref: /minix3/external/bsd/llvm/dist/clang/test/Rewriter/rewrite-message-expr.mm (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o %t-rw.cpp
2*f4a2713aSLionel Sambuc// RUN: FileCheck -check-prefix CHECK-LP --input-file=%t-rw.cpp %s
3*f4a2713aSLionel Sambuc// radar 7617047
4*f4a2713aSLionel Sambuc
5*f4a2713aSLionel Sambuc@interface Baz
6*f4a2713aSLionel Sambuc- (id)y;
7*f4a2713aSLionel Sambuc+ (id)z;
8*f4a2713aSLionel Sambuc@end
9*f4a2713aSLionel Sambuc
10*f4a2713aSLionel Sambuc@interface Foo {
11*f4a2713aSLionel Sambuc@public
12*f4a2713aSLionel Sambuc	int bar;
13*f4a2713aSLionel Sambuc}
14*f4a2713aSLionel Sambuc@end
15*f4a2713aSLionel Sambuc
16*f4a2713aSLionel Sambucextern Foo* x(id a);
17*f4a2713aSLionel Sambuc
18*f4a2713aSLionel Sambucint f(Baz *baz) {
19*f4a2713aSLionel Sambuc	int i = x([Baz z])->bar;
20*f4a2713aSLionel Sambuc        int j = ((Foo*)[Baz z])->bar;
21*f4a2713aSLionel Sambuc        int k = x([baz y])->bar;
22*f4a2713aSLionel Sambuc        return i+j+k;
23*f4a2713aSLionel Sambuc}
24*f4a2713aSLionel Sambuc
25*f4a2713aSLionel Sambuc// CHECK-LP: ((struct Foo_IMPL *)x(((id (*)(id, SEL))(void *)objc_msgSend)(objc_getClass("Baz"), sel_registerName("z"))))->bar
26