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 -fnext-runtime" }
6 #include <objc/objc-runtime.h>
8 #define CHECK_IF(expr) if(!(expr)) abort()
10 #ifndef CLS_HAS_CXX_STRUCTORS
11 #define CLS_HAS_CXX_STRUCTORS 0x2000L
16 cxx_struct (void) { a = b = 55; }
40 cls = objc_getClass("Foo");
41 CHECK_IF(cls->info & CLS_HAS_CXX_STRUCTORS);
42 cls = objc_getClass("Bar");
43 CHECK_IF(!(cls->info & CLS_HAS_CXX_STRUCTORS));