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