1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck -check-prefix CHECK-LP64 %s
2 // RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck -check-prefix CHECK-LP32 %s
4 typedef struct objc_class *Class;
6 typedef struct objc_object {
12 - (void)meth : (id)object : (id)src_object;
13 + (unsigned char) isSubclassOfClass:(Class)aClass ;
17 + (Class) class {return 0;}
18 + (unsigned char) isSubclassOfClass:(Class)aClass {return 0;}
19 - (void)meth : (id)object : (id)src_object {
20 [object->isa isSubclassOfClass:[I class]];
22 [(*object).isa isSubclassOfClass:[I class]];
24 object->isa = src_object->isa;
25 (*src_object).isa = (*object).isa;
32 Class Test(const void *inObject1) {
33 if(((id)inObject1)->isa == MyClass)
34 return ((id)inObject1)->isa;
47 return (*[Foo method]).isa;
48 return [Foo method]->isa;
54 @interface SuperCat : Cat {}
55 +(void)geneticallyAlterCat:(Cat *)cat;
58 @implementation SuperCat
59 + (void)geneticallyAlterCat:(Cat *)cat {
60 Class dynamicSubclass;
61 ((id)cat)->isa = dynamicSubclass;
64 // CHECK-LP64: %{{.*}} = load ptr, ptr %
65 // CHECK-NEXT: store ptr %{{.*}}, ptr %{{.*}}
67 // CHECK-LP32: %{{.*}} = load ptr, ptr %
68 // CHECK-NEXT: store ptr %{{.*}}, ptr %{{.*}}