OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [objc.dg/] [isa-field-1.m] - Blame information for rev 455

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Ensure there are no bizarre difficulties with accessing the 'isa' field of objects.  */
2
/* { dg-do compile { target *-*-darwin* } } */
3
 
4
#include <objc/Object.h>
5
 
6
@interface Object (Test)
7
- (Class) test1: (id)object;
8
@end
9
 
10
@interface Derived: Object
11
- (Class) test2: (id)object;
12
@end
13
 
14
@implementation Object (Test)
15
 
16
Class test1(id object) {
17
    Class cls = object->isa;
18
    return cls;
19
}
20
- (Class) test1: (id)object {
21
    Class cls = object->isa;
22
    return cls;
23
}
24
 
25
@end
26
 
27
@implementation Derived
28
 
29
Class test2(id object) {
30
    Class cls = object->isa;
31
    return cls;
32
}
33
- (Class) test2: (id)object {
34
    Class cls = object->isa;
35
    return cls;
36
}
37
 
38
@end
39
 
40
Class test3(id object) {
41
    Class cls = object->isa;
42
    return cls;
43
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.