Anders Carlsson | 7e70fb2 | 2010-06-21 20:59:55 +0000 | [diff] [blame] | 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: define void @_Z1fP1B |
| 21 | // CHECK: objc_msgSend to |
Anders Carlsson | 0ea4dfd | 2010-07-16 21:18:37 +0000 | [diff] [blame] | 22 | // CHECK-NOT: call void @_ZN1AD1Ev |
Anders Carlsson | 7e70fb2 | 2010-06-21 20:59:55 +0000 | [diff] [blame] | 23 | // CHECK: ret void |
| 24 | void f(B* b) { |
| 25 | (void)[b getA]; |
| 26 | } |
Douglas Gregor | 569c316 | 2010-08-07 11:51:51 +0000 | [diff] [blame] | 27 | |
| 28 | // PR7741 |
| 29 | @protocol P1 @end |
| 30 | @protocol P2 @end |
| 31 | @protocol P3 @end |
| 32 | @interface foo<P1> {} @end |
Fariborz Jahanian | b7bc34a | 2011-04-08 18:25:29 +0000 | [diff] [blame^] | 33 | @interface bar : foo <P1, P2, P3> {} @end |
Douglas Gregor | 569c316 | 2010-08-07 11:51:51 +0000 | [diff] [blame] | 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 | } |