URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 154 |
Rev 816 |
/* Test simple ObjC types casts. */
|
/* Test simple ObjC types casts. */
|
/* Author: Nicola Pero . */
|
/* Author: Nicola Pero . */
|
/* { dg-do compile } */
|
/* { dg-do compile } */
|
|
|
#include
|
#include
|
|
|
@protocol MyProtocol
|
@protocol MyProtocol
|
- (void) foo;
|
- (void) foo;
|
@end
|
@end
|
|
|
@interface MyClass
|
@interface MyClass
|
@end
|
@end
|
|
|
int main()
|
int main()
|
{
|
{
|
id obj = nil;
|
id obj = nil;
|
id obj_p = nil;
|
id obj_p = nil;
|
MyClass *obj_c = nil;
|
MyClass *obj_c = nil;
|
Class obj_C = Nil;
|
Class obj_C = Nil;
|
|
|
/* All these casts should generate no warnings. */
|
/* All these casts should generate no warnings. */
|
|
|
obj = (id)obj_p;
|
obj = (id)obj_p;
|
obj = (id)obj_c;
|
obj = (id)obj_c;
|
obj = (id)obj_C;
|
obj = (id)obj_C;
|
obj_c = (MyClass *)obj;
|
obj_c = (MyClass *)obj;
|
obj_c = (MyClass *)obj_p;
|
obj_c = (MyClass *)obj_p;
|
obj_c = (MyClass *)obj_C;
|
obj_c = (MyClass *)obj_C;
|
obj_p = (id)obj;
|
obj_p = (id)obj;
|
obj_p = (id)obj_c;
|
obj_p = (id)obj_c;
|
obj_p = (id)obj_C;
|
obj_p = (id)obj_C;
|
obj_C = (Class)obj;
|
obj_C = (Class)obj;
|
obj_C = (Class)obj_p;
|
obj_C = (Class)obj_p;
|
obj_C = (Class)obj_c;
|
obj_C = (Class)obj_c;
|
|
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.