blob: 6265c7be7613fc970f0486b4e8c40f928f02c706 [file] [log] [blame]
Anders Carlsson7e70fb22010-06-21 20:59:55 +00001// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
2
3struct 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 Carlsson0ea4dfd2010-07-16 21:18:37 +000022// CHECK-NOT: call void @_ZN1AD1Ev
Anders Carlsson7e70fb22010-06-21 20:59:55 +000023// CHECK: ret void
24void f(B* b) {
25 (void)[b getA];
26}
Douglas Gregor569c3162010-08-07 11:51:51 +000027
28// PR7741
29@protocol P1 @end
30@protocol P2 @end
31@protocol P3 @end
32@interface foo<P1> {} @end
Fariborz Jahanianb7bc34a2011-04-08 18:25:29 +000033@interface bar : foo <P1, P2, P3> {} @end
Douglas Gregor569c3162010-08-07 11:51:51 +000034typedef bar baz;
35void f5(foo&);
36void f5b(foo<P1>&);
37void f5c(foo<P2>&);
38void f5d(foo<P3>&);
39void f6(baz* x) {
40 f5(*x);
41 f5b(*x);
42 f5c(*x);
43 f5d(*x);
44 (void)((foo&)*x);
45}