1 /* { dg-do run { target "*-*-darwin*" } } */
2 /* { dg-options "-framework Foundation" } */
4 /* This tests that exceptions work. It used to fail because
5 objc_msgSend was marked with DECL_NOTHROW.
6 If you include objc/Object.h, the problem goes away, because
7 that file includes objc/objc-runtime.h which explicitly prototypes
8 objc_msgSend without 'nothrow'. */
10 #include <Foundation/Foundation.h>
14 // ObjectiveC class header
15 @interface ObjCclass : NSObject {
29 int main(int argc, char *argv[])
31 ObjCclass * foo = [[ObjCclass alloc] init];
37 // ObjectiveC implementation
38 @implementation ObjCclass
60 void CPPclass::function1()
63 /* Shouldn't be here because we threw. */