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-skip-if "Headers incompatible with 10.4 APIs" { *-*-darwin1[1-9]* *-*-darwin2[0-9]* } { "-fnext-runtime" } { "" } }
6 // { dg-additional-options "-fobjc-call-cxx-cdtors -mmacosx-version-min=10.4 -framework Foundation" }
7 // This test has no equivalent or meaning for m64/ABI V2
8 // { dg-xfail-run-if "No Test Avail" { *-*-darwin* && lp64 } { "-fnext-runtime" } { "" } }
11 #include "../objc-obj-c++-shared/F-NSObject.h"
12 #include <objc/objc-runtime.h>
14 //extern "C" { int printf(const char *,...); }
15 #define CHECK_IF(expr) if(!(expr)) abort()
17 #ifndef CLS_HAS_CXX_STRUCTORS
18 #define CLS_HAS_CXX_STRUCTORS 0x2000L
23 cxx_struct (void) { a = b = 55; }
26 @interface Foo: NSObject {
48 cls = objc_getClass("Foo");
49 // printf((const char *)"Foo info %lx\n",cls->info);
50 CHECK_IF((cls->info & CLS_HAS_CXX_STRUCTORS) != 0);
51 cls = objc_getClass("Bar");
52 // printf((const char *)"Bar info %lx\n",cls->info);
53 CHECK_IF((cls->info & CLS_HAS_CXX_STRUCTORS) == 0);
56 /* No test needed or available. */