1 /* Check that the '-fzero-link' flag doesn't prevent messaging from working. */
2 /* Contributed by Ziemowit Laski <zlaski@apple.com>. */
4 /* { dg-do run { target *-*-darwin* } } */
5 /* { dg-additional-options "-fzero-link" } */
6 /* { dg-additional-options "-framework Foundation" { target { *-*-darwin* } } } */
7 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
9 #ifdef __NEXT_RUNTIME__
10 # include "../objc-obj-c++-shared/F-NSObject.h"
11 # define OBJECT NSObject
13 # include <objc/Object.h>
14 # include <objc/Protocol.h>
15 # define OBJECT Object
18 extern void abort(void);
19 #define CHECK_IF(expr) if(!(expr)) abort();
21 @interface Base: OBJECT
26 + (int) getValue { return 1593; }
30 int val = [Base getValue];
31 CHECK_IF(val == 1593);