1 /* Check if the '-fzero-link' flag correctly emits an objc_getClass() call. */
2 /* Contributed by Ziemowit Laski <zlaski@apple.com>. */
4 /* { dg-do compile { target *-*-darwin* } } */
5 /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
6 /* { dg-options "-fzero-link" } */
8 #include <Foundation/NSObject.h>
10 extern void abort(void);
11 #define CHECK_IF(expr) if(!(expr)) abort();
13 @interface Base: NSObject
18 + (int) getValue { return 1593; }
22 int val = [Base getValue];
23 CHECK_IF(val == 1593);
27 /* { dg-final { scan-assembler-not "_OBJC_ClassRefs_0" { target { *-*-darwin* && { ! lp64 } } } } } */
28 /* { dg-final { scan-assembler-not "_OBJC_ClassRef_Base" { target { *-*-darwin* && { lp64 } } } } } */
29 /* { dg-final { scan-assembler "objc_getClass" } } */