summaryrefslogtreecommitdiff
path: root/clang/test/Rewriter/rewrite-message-expr.mm
blob: dafb31b2b543b3cf558ac94545c06fef7091c9a7 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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