2010-06-22 04:59:55 +08:00
|
|
|
// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
|
|
|
|
|
|
|
|
struct A { ~A(); };
|
|
|
|
|
|
|
|
@interface B {
|
|
|
|
A a;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (const A&)getA;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation B
|
|
|
|
|
|
|
|
- (const A&)getA {
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
// CHECK: define void @_Z1fP1B
|
|
|
|
// CHECK: objc_msgSend to
|
2010-07-17 05:18:37 +08:00
|
|
|
// CHECK-NOT: call void @_ZN1AD1Ev
|
2010-06-22 04:59:55 +08:00
|
|
|
// CHECK: ret void
|
|
|
|
void f(B* b) {
|
|
|
|
(void)[b getA];
|
|
|
|
}
|
2010-08-07 19:51:51 +08:00
|
|
|
|
|
|
|
// PR7741
|
|
|
|
@protocol P1 @end
|
|
|
|
@protocol P2 @end
|
|
|
|
@protocol P3 @end
|
|
|
|
@interface foo<P1> {} @end
|
|
|
|
@interface bar : foo <P1, P2> {} @end
|
|
|
|
typedef bar baz;
|
|
|
|
void f5(foo&);
|
|
|
|
void f5b(foo<P1>&);
|
|
|
|
void f5c(foo<P2>&);
|
|
|
|
void f5d(foo<P3>&);
|
|
|
|
void f6(baz* x) {
|
|
|
|
f5(*x);
|
|
|
|
f5b(*x);
|
|
|
|
f5c(*x);
|
|
|
|
f5d(*x);
|
|
|
|
(void)((foo&)*x);
|
|
|
|
}
|