OSDN Git Service

gcc:
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / objc.dg / image-info.m
1 /* Check if the '-freplace-objc-classes' option causes the
2    __OBJC,__image_info section to be emitted.  This is only
3    usable on MacOS X 10.3 and later. */
4 /* Contributed by Ziemowit Laski <zlaski@apple.com>.  */
5
6 /* { dg-do compile { target { *-*-darwin* } } } */
7 /* { dg-skip-if "NeXT-only" { *-*-* } { "-fgnu-runtime" } { "" } } */
8 /* { dg-options "-freplace-objc-classes" } */
9
10 #include "../objc-obj-c++-shared/Object1.h"
11 #include <objc/objc.h>
12
13 extern void abort(void);
14
15 #define CHECK_IF(expr) if(!(expr)) abort();
16
17 @interface Base: Object {
18 @public
19   int a;
20   float b;
21   char c;
22 }
23 - init;
24 @end
25
26 @implementation Base
27 - init {
28   [super init];
29   a = 123;
30   b = 1.23;
31   c = 'c';
32   return self;
33 }
34 @end
35
36 /* { dg-final { scan-assembler "\t.section __OBJC, __image_info.*\n\t.align.*\nL_OBJC_IMAGE_INFO.*:\n\t.long\t0\n\t.long\t1" } } */