summaryrefslogtreecommitdiff
path: root/test/CodeGenObjC/parameterized_classes.m
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-06-01 20:58:49 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-06-01 20:58:49 +0000
commit416ada0f75bab22b084a1776deb229cd4a669c4d (patch)
tree6eb65f3790434471361628af6199b07a4de92de7 /test/CodeGenObjC/parameterized_classes.m
parent550ae89a710bf458d47e5b1d183f5e7039c2b384 (diff)
Vendor import of clang trunk r304460:vendor/clang/clang-trunk-r304460
Notes
svn path=/vendor/clang/dist/; revision=319463 svn path=/vendor/clang/clang-trunk-r304460/; revision=319464; tag=vendor/clang/clang-trunk-r304460
Diffstat (limited to 'test/CodeGenObjC/parameterized_classes.m')
-rw-r--r--test/CodeGenObjC/parameterized_classes.m28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/CodeGenObjC/parameterized_classes.m b/test/CodeGenObjC/parameterized_classes.m
index b75cf2e3ad2d..8fe5c52b8d39 100644
--- a/test/CodeGenObjC/parameterized_classes.m
+++ b/test/CodeGenObjC/parameterized_classes.m
@@ -68,3 +68,31 @@ void blockTest(NSMutableArray<void (^)(void)> *array, NSString *name) {
// CHECK: call i8* @objc_retainBlock
// CHECK: ret void
}
+
+// CHECK-LABEL: define internal void @"\01-[Derived setDest:]
+// CHECK: %[[SELFADDR:.*]] = alloca %[[SELFTY:.*]]*
+// CHECK: %[[AADDR:.*]] = alloca %[[IVARTY:.*]]*
+// CHECK: %[[V2:.*]] = load %[[IVARTY]]*, %[[IVARTY]]** %[[AADDR]]
+// CHECK: %[[V3:.*]] = load %[[SELFTY]]*, %[[SELFTY]]** %[[SELFADDR]]
+// CHECK: %[[IVAR:.*]] = load i64, i64* @"OBJC_IVAR_$_Base._destination"
+// CHECK: %[[V4:.*]] = bitcast %[[SELFTY]]* %[[V3]] to i8*
+// CHECK: %[[ADDPTR:.*]] = getelementptr inbounds i8, i8* %[[V4]], i64 %[[IVAR]]
+// CHECK: %[[V5:.*]] = bitcast i8* %[[ADDPTR]] to %[[IVARTY]]**
+// CHECK: %[[V6:.*]] = bitcast %[[IVARTY]]** %[[V5]] to i8**
+// CHECK: %[[V7:.*]] = bitcast %[[IVARTY]]* %[[V2]] to i8*
+// CHECK: call void @objc_storeStrong(i8** %[[V6]], i8* %[[V7]])
+
+@interface Base<DestType> : NSObject {
+ DestType _destination;
+}
+@end
+
+@interface Derived : Base<NSObject *>
+- (void)setDest:(NSObject *)a;
+@end
+
+@implementation Derived
+- (void)setDest:(NSObject *)a {
+ _destination = a;
+}
+@end