xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenObjCXX/message-reference.mm (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s
2f4a2713aSLionel Sambuc// rdar://8604515
3f4a2713aSLionel Sambuc
4f4a2713aSLionel Sambuc@interface I {}
5f4a2713aSLionel Sambuc-(unsigned int&)referenceCount;
6f4a2713aSLionel Sambuc@end
7f4a2713aSLionel Sambuc
8f4a2713aSLionel Sambuc@interface MyClass
9f4a2713aSLionel Sambuc+(int)writeBlip:(I*)srcBlip;
10f4a2713aSLionel Sambuc@end
11f4a2713aSLionel Sambuc
12f4a2713aSLionel Sambuc@implementation MyClass
13f4a2713aSLionel Sambuc+(int)writeBlip:(I*)srcBlip{
14f4a2713aSLionel Sambuc  return ([srcBlip referenceCount] == 0);
15f4a2713aSLionel Sambuc}
16f4a2713aSLionel Sambuc@end
17f4a2713aSLionel Sambuc
18*0a6a1f1dSLionel Sambuc// CHECK: [[T:%.*]] = call dereferenceable({{[0-9]+}}) i32* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend
19f4a2713aSLionel Sambuc// CHECK: [[U:%.*]] = load i32* [[T]]
20f4a2713aSLionel Sambuc// CHECK  [[V:%.*]] = icmp eq i32 [[U]], 0
21