Fix code gen bug generating code for
((id)cat)->isa. Fixes radar 7709015.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97672 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenObjC/id-isa-codegen.m b/test/CodeGenObjC/id-isa-codegen.m
index 3179e11..e893aaa 100644
--- a/test/CodeGenObjC/id-isa-codegen.m
+++ b/test/CodeGenObjC/id-isa-codegen.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -o %t %s
+// RUN: %clang_cc1 -emit-llvm -o - %s
typedef struct objc_class *Class;
@@ -48,3 +48,19 @@
return (*[Foo method]).isa;
return [Foo method]->isa;
}
+
+// rdar 7709015
+@interface Cat {}
+@end
+
+@interface SuperCat : Cat {}
++(void)geneticallyAlterCat:(Cat *)cat;
+@end
+
+@implementation SuperCat
++ (void)geneticallyAlterCat:(Cat *)cat {
+ Class dynamicSubclass;
+ ((id)cat)->isa = dynamicSubclass;
+}
+@end
+