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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [objc.dg/] [isa-field-1.m] - Blame information for rev 816

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

Line No. Rev Author Line
1 309 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/Object1.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
#ifdef __NEXT_RUNTIME__
18
    Class cls = object->isa;
19
#else
20
    Class cls = object->class_pointer;
21
#endif
22
    return cls;
23
}
24
- (Class) test1: (id)object {
25
#ifdef __NEXT_RUNTIME__
26
    Class cls = object->isa;
27
#else
28
    Class cls = object->class_pointer;
29
#endif
30
    return cls;
31
}
32
 
33
@end
34
 
35
@implementation Derived
36
 
37
Class test2(id object) {
38
#ifdef __NEXT_RUNTIME__
39
    Class cls = object->isa;
40
#else
41
    Class cls = object->class_pointer;
42
#endif
43
    return cls;
44
}
45
- (Class) test2: (id)object {
46
#ifdef __NEXT_RUNTIME__
47
    Class cls = object->isa;
48
#else
49
    Class cls = object->class_pointer;
50
#endif
51
    return cls;
52
}
53
 
54
@end
55
 
56
Class test3(id object) {
57
#ifdef __NEXT_RUNTIME__
58
    Class cls = object->isa;
59
#else
60
    Class cls = object->class_pointer;
61
#endif
62
    return cls;
63
}

powered by: WebSVN 2.1.0

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