summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC/parameterized_classes.m
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2017-06-28 00:42:48 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2017-06-28 00:42:48 +0000
commit46dd7dbc8cbd87ce09acf118f7ea14b8986e5e6a (patch)
treeea29ece85605e2154e6ba29e88990a8c20720742 /clang/test/CodeGenObjC/parameterized_classes.m
parent9e4519db1e01e91ee90d80a8a2a2611e02b51f06 (diff)
downloadbcm5719-llvm-46dd7dbc8cbd87ce09acf118f7ea14b8986e5e6a.tar.gz
bcm5719-llvm-46dd7dbc8cbd87ce09acf118f7ea14b8986e5e6a.zip
[CodeGen] Fix assertion failure in EmitCallArg.
The assertion was failing when a method of a parameterized class was called and the types of the argument and parameter didn't match. To fix the failure, move the assertion in EmitCallArg to its only caller EmitCallArgs and require the argument and parameter types match only when the method is not parameterized. rdar://problem/32874473 Differential Revision: https://reviews.llvm.org/D34665 llvm-svn: 306494
Diffstat (limited to 'clang/test/CodeGenObjC/parameterized_classes.m')
-rw-r--r--clang/test/CodeGenObjC/parameterized_classes.m28
1 files changed, 28 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/parameterized_classes.m b/clang/test/CodeGenObjC/parameterized_classes.m
index 8fe5c52b8d3..34aca35af31 100644
--- a/clang/test/CodeGenObjC/parameterized_classes.m
+++ b/clang/test/CodeGenObjC/parameterized_classes.m
@@ -96,3 +96,31 @@ void blockTest(NSMutableArray<void (^)(void)> *array, NSString *name) {
_destination = a;
}
@end
+
+// CHECK-LABEL: define internal void @"\01-[C0 foo1]"(
+// CHECK: {{.*}} = alloca
+// CHECK: {{.*}} = alloca
+// CHECK: %[[D:.*]] = alloca %[[TY:.*]]*
+// CHECK: %[[TEMP:.*]] = alloca %[[TY]]*
+// CHECK: %[[V4:.*]] = load %[[TY]]*, %[[TY]]** %[[D]]
+// CHECK: store %[[TY]]* %[[V4]], %[[TY]]** %[[TEMP]]
+// CHECK: %[[V7:.*]] = bitcast %[[TY]]** %[[TEMP]] to i8**
+// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i8**)*)(i8* %{{.*}}, i8* %{{.*}}, i8** %[[V7]])
+
+@interface P0<ObjectType> : NSObject
+- (void)m0:(ObjectType *)first;
+@end
+
+@interface C0 : NSObject
+-(void)foo1;
+@end
+
+@implementation C0 {
+ P0<NSString *> *x;
+}
+
+-(void)foo1 {
+ NSString *d;
+ [x m0:&d];
+}
+@end
OpenPOWER on IntegriCloud