URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc3/] [gcc/] [testsuite/] [objc.dg/] [isa-field-1.m] - Rev 594
Go to most recent revision | Compare with Previous | Blame | View Log
/* Ensure there are no bizarre difficulties with accessing the 'isa' field of objects. */ /* { dg-do compile } */ #include "../objc-obj-c++-shared/Object1.h" @interface Object (Test) - (Class) test1: (id)object; @end @interface Derived: Object - (Class) test2: (id)object; @end @implementation Object (Test) Class test1(id object) { #ifdef __NEXT_RUNTIME__ Class cls = object->isa; #else Class cls = object->class_pointer; #endif return cls; } - (Class) test1: (id)object { #ifdef __NEXT_RUNTIME__ Class cls = object->isa; #else Class cls = object->class_pointer; #endif return cls; } @end @implementation Derived Class test2(id object) { #ifdef __NEXT_RUNTIME__ Class cls = object->isa; #else Class cls = object->class_pointer; #endif return cls; } - (Class) test2: (id)object { #ifdef __NEXT_RUNTIME__ Class cls = object->isa; #else Class cls = object->class_pointer; #endif return cls; } @end Class test3(id object) { #ifdef __NEXT_RUNTIME__ Class cls = object->isa; #else Class cls = object->class_pointer; #endif return cls; }
Go to most recent revision | Compare with Previous | Blame | View Log