URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 308 |
Rev 384 |
/* Check @defs() in Objective-C++ */
|
/* Check @defs() in Objective-C++ */
|
/* Contributed by Devang Patel */
|
/* Contributed by Devang Patel */
|
/* { dg-options "" } */
|
/* { dg-options "" } */
|
/* { dg-do run } */
|
/* { dg-do run } */
|
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
|
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
|
#include "../objc-obj-c++-shared/Object1.h"
|
#include "../objc-obj-c++-shared/Object1.h"
|
#include
|
#include
|
#include
|
#include
|
|
|
extern "C" void abort(void);
|
extern "C" 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;
|
}
|
}
|
#include "../objc-obj-c++-shared/Object1-implementation.h"
|
#include "../objc-obj-c++-shared/Object1-implementation.h"
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.