OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [obj-c++.dg/] [cxx-ivars-3.mm] - Diff between revs 308 and 338

Only display areas with differences | Details | Blame | View Log

Rev 308 Rev 338
// 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-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } }
// { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } }
// { dg-options "-fobjc-call-cxx-cdtors -mmacosx-version-min=10.4" }
// { dg-options "-fobjc-call-cxx-cdtors -mmacosx-version-min=10.4" }
// This test has no equivalent or meaning for m64/ABI V2
// This test has no equivalent or meaning for m64/ABI V2
// { dg-xfail-run-if "No Test Avail" { *-*-darwin* && lp64 } { "-fnext-runtime" } { "" } }
// { dg-xfail-run-if "No Test Avail" { *-*-darwin* && lp64 } { "-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)
{
{
#ifndef __LP64__
#ifndef __LP64__
  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));
#else
#else
  /* No test needed or available.  */
  /* No test needed or available.  */
  abort ();
  abort ();
#endif
#endif
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.