diff options
author | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-10-15 17:10:06 +1100 |
---|---|---|
committer | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-10-15 17:10:06 +1100 |
commit | be1de4be954c80875ad4108e0a33e8e131b2f2c0 (patch) | |
tree | 1fbbecf276bf7c7bdcbb4dd446099d6d90eaa516 /clang/test/CodeGenObjCXX/references.mm | |
parent | c4626a62754862d20b41e8a46a3574264ea80e6d (diff) | |
parent | f1bd2e48c5324d3f7cda4090c87f8a5b6f463ce2 (diff) |
Merge branch 'master' of ssh://bitbucket.org/czan/honours
Diffstat (limited to 'clang/test/CodeGenObjCXX/references.mm')
-rw-r--r-- | clang/test/CodeGenObjCXX/references.mm | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjCXX/references.mm b/clang/test/CodeGenObjCXX/references.mm new file mode 100644 index 0000000..6265c7b --- /dev/null +++ b/clang/test/CodeGenObjCXX/references.mm @@ -0,0 +1,45 @@ +// 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 +// CHECK-NOT: call void @_ZN1AD1Ev +// CHECK: ret void +void f(B* b) { + (void)[b getA]; +} + +// PR7741 +@protocol P1 @end +@protocol P2 @end +@protocol P3 @end +@interface foo<P1> {} @end +@interface bar : foo <P1, P2, P3> {} @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); +} |