brintos

brintos / llvm-project-archived public Read only

0
0
Text · 684 B · e922d27 Raw
46 lines · plain
1// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s2 3struct A { ~A(); };4 5@interface B {6  A a;7}8 9- (const A&)getA;10@end11 12@implementation B 13 14- (const A&)getA {15  return a;16}17 18@end19 20// CHECK-LABEL: define{{.*}} void @_Z1fP1B21// CHECK: objc_msgSend22// CHECK-NOT: call void @_ZN1AD1Ev23// CHECK: ret void24void f(B* b) {25  (void)[b getA];26}27 28// PR774129@protocol P1 @end30@protocol P2 @end31@protocol P3 @end32@interface foo<P1> {} @end33@interface bar : foo <P1, P2, P3> {} @end34typedef 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}46