OSDN Git Service

2011-10-18 Janus Weil <janus@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / objc.dg / zero-link-3.m
1 /* Check that the '-fzero-link' flag doesn't prevent messaging from working. */
2 /* Contributed by Ziemowit Laski <zlaski@apple.com>.  */
3
4 /* { dg-do run { target *-*-darwin* } } */
5 /* { dg-options "-fzero-link" } */
6 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
7
8 #include <objc/Object.h>
9
10 extern void abort(void);
11 #define CHECK_IF(expr) if(!(expr)) abort();
12
13 @interface Base: Object
14 + (int) getValue;
15 @end
16
17 @implementation Base
18 + (int) getValue { return 1593; }
19 @end
20
21 int main(void) {
22   int val = [Base getValue];
23   CHECK_IF(val == 1593);
24   return 0;
25 }
26