1 // Check if ObjC classes with non-POD C++ ivars are specially marked in the metadata.
3 // { dg-do run { target *-*-darwin* } }
4 // { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } }
5 // { dg-options "-fobjc-call-cxx-cdtors" }
6 // { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } }
8 #include "../objc-obj-c++-shared/Object1.h"
9 #include "../objc-obj-c++-shared/next-mapping.h"
12 #define CHECK_IF(expr) if(!(expr)) abort()
14 #ifndef CLS_HAS_CXX_STRUCTORS
15 #define CLS_HAS_CXX_STRUCTORS 0x2000L
20 cxx_struct (void) { a = b = 55; }
44 cls = objc_get_class("Foo");
45 #if NEXT_OBJC_USE_NEW_INTERFACE
46 CHECK_IF(class_isMetaClass(cls) & CLS_HAS_CXX_STRUCTORS);
47 cls = objc_getClass("Bar");
48 CHECK_IF(!(class_isMetaClass(cls) & CLS_HAS_CXX_STRUCTORS));
50 CHECK_IF(cls->info & CLS_HAS_CXX_STRUCTORS);
51 cls = objc_getClass("Bar");
52 CHECK_IF(!(cls->info & CLS_HAS_CXX_STRUCTORS));
56 #include "../objc-obj-c++-shared/Object1-implementation.h"