From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/CodeGenObjCXX/references.mm | 45 ++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 clang/test/CodeGenObjCXX/references.mm (limited to 'clang/test/CodeGenObjCXX/references.mm') 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 {} @end +@interface bar : foo {} @end +typedef bar baz; +void f5(foo&); +void f5b(foo&); +void f5c(foo&); +void f5d(foo&); +void f6(baz* x) { + f5(*x); + f5b(*x); + f5c(*x); + f5d(*x); + (void)((foo&)*x); +} -- cgit v1.2.3