summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGenObjC')
-rw-r--r--clang/test/CodeGenObjC/objc-alloc-init.m11
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/test/CodeGenObjC/objc-alloc-init.m b/clang/test/CodeGenObjC/objc-alloc-init.m
index c5c1a763b7c..8370202748e 100644
--- a/clang/test/CodeGenObjC/objc-alloc-init.m
+++ b/clang/test/CodeGenObjC/objc-alloc-init.m
@@ -22,21 +22,30 @@ void f() {
}
@interface Y : X
++(Class)class;
+(void)meth;
-(void)instanceMeth;
@end
@implementation Y
++(Class)class {
+ return self;
+}
+(void)meth {
[[self alloc] init];
// OPTIMIZED: call i8* @objc_alloc_init(
// NOT_OPTIMIZED: call i8* @objc_alloc(
}
++ (void)meth2 {
+ [[[self class] alloc] init];
+ // OPTIMIZED: call i8* @objc_alloc_init(
+ // NOT_OPTIMIZED: call i8* @objc_alloc(
+}
-(void)instanceMeth {
// EITHER-NOT: call i8* @objc_alloc
// EITHER: call {{.*}} @objc_msgSend
// EITHER: call {{.*}} @objc_msgSend
- [[self alloc] init];
+ [[(id)self alloc] init];
}
@end
OpenPOWER on IntegriCloud