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 |
/* Check @defs() in Objective-C++ */
|
/* Check @defs() in Objective-C++ */
|
/* Contributed by Devang Patel */
|
/* Contributed by Devang Patel */
|
|
|
/* { dg-options "-lobjc" } */
|
/* { dg-options "-lobjc" } */
|
/* { dg-do run } */
|
/* { dg-do run } */
|
|
|
#include
|
#include
|
#include
|
#include
|
#include
|
#include
|
|
|
extern void abort(void);
|
extern void abort(void);
|
|
|
@interface A : Object
|
@interface A : Object
|
{
|
{
|
@public
|
@public
|
int a;
|
int a;
|
}
|
}
|
@end
|
@end
|
|
|
struct A_defs
|
struct A_defs
|
{
|
{
|
@defs(A);
|
@defs(A);
|
};
|
};
|
|
|
@implementation A
|
@implementation A
|
- init
|
- init
|
{
|
{
|
a = 42;
|
a = 42;
|
return self;
|
return self;
|
}
|
}
|
@end
|
@end
|
|
|
|
|
int main()
|
int main()
|
{
|
{
|
A *a = [A init];
|
A *a = [A init];
|
struct A_defs *a_defs = (struct A_defs *)a;
|
struct A_defs *a_defs = (struct A_defs *)a;
|
|
|
if (a->a != a_defs->a)
|
if (a->a != a_defs->a)
|
abort ();
|
abort ();
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.