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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [isa-field-1.m] - Blame information for rev 774

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

Line No. Rev Author Line
1 704 jeremybenn
/* Ensure there are no bizarre difficulties with accessing the 'isa' field of objects.  */
2
/* { dg-do compile } */
3
 
4
#include "../objc-obj-c++-shared/TestsuiteObject.h"
5
#include "../objc-obj-c++-shared/runtime.h"
6
 
7
@interface TestsuiteObject (Test)
8
- (Class) test1: (id)object;
9
@end
10
 
11
@interface Derived: TestsuiteObject
12
- (Class) test2: (id)object;
13
@end
14
 
15
@implementation TestsuiteObject (Test)
16
 
17
Class test1(id object) {
18
#ifdef __NEXT_RUNTIME__
19
    Class cls = object->isa;
20
#else
21
    Class cls = object->class_pointer;
22
#endif
23
    return cls;
24
}
25
- (Class) test1: (id)object {
26
#ifdef __NEXT_RUNTIME__
27
    Class cls = object->isa;
28
#else
29
    Class cls = object->class_pointer;
30
#endif
31
    return cls;
32
}
33
 
34
@end
35
 
36
@implementation Derived
37
 
38
Class test2(id object) {
39
#ifdef __NEXT_RUNTIME__
40
    Class cls = object->isa;
41
#else
42
    Class cls = object->class_pointer;
43
#endif
44
    return cls;
45
}
46
- (Class) test2: (id)object {
47
#ifdef __NEXT_RUNTIME__
48
    Class cls = object->isa;
49
#else
50
    Class cls = object->class_pointer;
51
#endif
52
    return cls;
53
}
54
 
55
@end
56
 
57
Class test3(id object) {
58
#ifdef __NEXT_RUNTIME__
59
    Class cls = object->isa;
60
#else
61
    Class cls = object->class_pointer;
62
#endif
63
    return cls;
64
}

powered by: WebSVN 2.1.0

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