OSDN Git Service

* gcc.target/cris/peep2-xsrand.c, gcc.target/cris/asmreg-1.c,
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / objc.dg / zero-link-2.m
1 /* Check if the '-fno-zero-link' flag correctly _omits_ an objc_getClass() call. */
2 /* Contributed by Ziemowit Laski <zlaski@apple.com>.  */
3 /* { dg-options "-fnext-runtime -fno-zero-link" } */
4 /* { dg-do compile } */
5
6 #include <objc/objc.h>
7 #include <objc/Object.h>
8
9 extern void abort(void);
10 #define CHECK_IF(expr) if(!(expr)) abort();
11
12 @interface Base: Object
13 + (int) getValue;
14 @end
15
16 @implementation Base
17 + (int) getValue { return 1593; }
18 @end
19
20 int main(void) {
21   int val = [Base getValue];
22   CHECK_IF(val == 1593);
23   return 0;
24 }
25
26 /* { dg-final { scan-assembler "_OBJC_CLASS_REFERENCES_0" } } */
27 /* { dg-final { scan-assembler-not "objc_getClass" } } */