summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/objc.dg/isa-field-1.m
blob: 6398b608d826aee96a5c138aeee209a72f908337 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* Ensure there are no bizarre difficulties with accessing the 'isa' field of objects.  */
/* { dg-do compile { target *-*-darwin* } } */

#include <objc/Object.h>

@interface Object (Test)
- (Class) test1: (id)object;
@end

@interface Derived: Object
- (Class) test2: (id)object;
@end

@implementation Object (Test)

Class test1(id object) {
    Class cls = object->isa;
    return cls;
}
- (Class) test1: (id)object {
    Class cls = object->isa;
    return cls;
}

@end

@implementation Derived

Class test2(id object) {
    Class cls = object->isa;
    return cls;
}
- (Class) test2: (id)object {
    Class cls = object->isa;
    return cls;
}

@end

Class test3(id object) {
    Class cls = object->isa;
    return cls;
}
OpenPOWER on IntegriCloud