OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [obj-c++.dg/] [isa-field-1.mm] - Blame information for rev 484

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

Line No. Rev Author Line
1 308 jeremybenn
/* Ensure there are no bizarre difficulties with accessing the 'isa' field of
2
  objects.  This field is named differently between GNU and NeXT runtimes so
3
  accessed via the CLASSPTRFIELD() macro defined in next-mapping.h */
4
/* { dg-do compile } */
5
 
6
#include "../objc-obj-c++-shared/Object1.h"
7
#include "../objc-obj-c++-shared/next-mapping.h"
8
 
9
@interface Object (Test)
10
- (Class) test1: (id)object;
11
@end
12
 
13
@interface Derived: Object
14
- (Class) test2: (id)object;
15
@end
16
 
17
@implementation Object (Test)
18
 
19
Class test1(id object) {
20
  Class cls = CLASSPTRFIELD(object);
21
  return cls;
22
}
23
- (Class) test1: (id)object {
24
  Class cls = CLASSPTRFIELD(object);
25
  return cls;
26
}
27
 
28
@end
29
 
30
@implementation Derived
31
 
32
Class test2(id object) {
33
  Class cls = CLASSPTRFIELD(object);
34
  return cls;
35
}
36
- (Class) test2: (id)object {
37
  Class cls = CLASSPTRFIELD(object);
38
  return cls;
39
}
40
 
41
@end
42
 
43
Class test3(id object) {
44
  Class cls = CLASSPTRFIELD(object);
45
  return cls;
46
}
47
#include "../objc-obj-c++-shared/Object1-implementation.h"

powered by: WebSVN 2.1.0

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