URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
// Check if ObjC classes with non-POD C++ ivars are specially marked in the metadata.
|
// Check if ObjC classes with non-POD C++ ivars are specially marked in the metadata.
|
|
|
// { dg-do run { target *-*-darwin* } }
|
// { dg-do run { target *-*-darwin* } }
|
// { dg-options "-fobjc-call-cxx-cdtors -fnext-runtime" }
|
// { dg-options "-fobjc-call-cxx-cdtors -fnext-runtime" }
|
|
|
#include
|
#include
|
#include
|
#include
|
#define CHECK_IF(expr) if(!(expr)) abort()
|
#define CHECK_IF(expr) if(!(expr)) abort()
|
|
|
#ifndef CLS_HAS_CXX_STRUCTORS
|
#ifndef CLS_HAS_CXX_STRUCTORS
|
#define CLS_HAS_CXX_STRUCTORS 0x2000L
|
#define CLS_HAS_CXX_STRUCTORS 0x2000L
|
#endif
|
#endif
|
|
|
struct cxx_struct {
|
struct cxx_struct {
|
int a, b;
|
int a, b;
|
cxx_struct (void) { a = b = 55; }
|
cxx_struct (void) { a = b = 55; }
|
};
|
};
|
|
|
@interface Foo {
|
@interface Foo {
|
int c;
|
int c;
|
cxx_struct s;
|
cxx_struct s;
|
}
|
}
|
@end
|
@end
|
|
|
@interface Bar: Foo {
|
@interface Bar: Foo {
|
float f;
|
float f;
|
}
|
}
|
@end
|
@end
|
|
|
@implementation Foo
|
@implementation Foo
|
@end
|
@end
|
|
|
@implementation Bar
|
@implementation Bar
|
@end
|
@end
|
|
|
int main (void)
|
int main (void)
|
{
|
{
|
Class cls;
|
Class cls;
|
|
|
cls = objc_getClass("Foo");
|
cls = objc_getClass("Foo");
|
CHECK_IF(cls->info & CLS_HAS_CXX_STRUCTORS);
|
CHECK_IF(cls->info & CLS_HAS_CXX_STRUCTORS);
|
cls = objc_getClass("Bar");
|
cls = objc_getClass("Bar");
|
CHECK_IF(!(cls->info & CLS_HAS_CXX_STRUCTORS));
|
CHECK_IF(!(cls->info & CLS_HAS_CXX_STRUCTORS));
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.