1 | // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s |
2 | |
3 | struct A { ~A(); }; |
4 | |
5 | @interface B { |
6 | A a; |
7 | } |
8 | |
9 | - (const A&)getA; |
10 | @end |
11 | |
12 | @implementation B |
13 | |
14 | - (const A&)getA { |
15 | return a; |
16 | } |
17 | |
18 | @end |
19 | |
20 | // CHECK-LABEL: define void @_Z1fP1B |
21 | // CHECK: objc_msgSend to |
22 | // CHECK-NOT: call void @_ZN1AD1Ev |
23 | // CHECK: ret void |
24 | void f(B* b) { |
25 | (void)[b getA]; |
26 | } |
27 | |
28 | // PR7741 |
29 | @protocol P1 @end |
30 | @protocol P2 @end |
31 | @protocol P3 @end |
32 | @interface foo<P1> {} @end |
33 | @interface bar : foo <P1, P2, P3> {} @end |
34 | typedef bar baz; |
35 | void f5(foo&); |
36 | void f5b(foo<P1>&); |
37 | void f5c(foo<P2>&); |
38 | void f5d(foo<P3>&); |
39 | void f6(baz* x) { |
40 | f5(*x); |
41 | f5b(*x); |
42 | f5c(*x); |
43 | f5d(*x); |
44 | (void)((foo&)*x); |
45 | } |
46 | |