1 /* Darwin (Mac OS X) pragma exercises. */
3 /* { dg-do run { target powerpc-*-darwin* } } */
4 /* { dg-options "-O -Wunused" } */
6 /* The mark pragma is to help decorate IDEs. */
8 extern void abort(void);
10 #pragma mark hey hey ho
12 /* The options pragma used to do a lot, now it's only for emulating
13 m68k alignment rules in structs. */
15 #pragma options 23 /* { dg-error "malformed '#pragma options'" } */
16 #pragma options align /* { dg-error "malformed '#pragma options'" } */
17 #pragma options align mac68k /* { dg-error "malformed '#pragma options'" } */
18 #pragma options align=45 /* { dg-error "malformed '#pragma options'" } */
19 #pragma options align=foo /* { dg-error "malformed '#pragma options align" } */
21 #pragma options align=mac68k
22 struct s1
{ short f1
; int f2
; };
23 #pragma options align=power
24 struct s2
{ short f1
; int f2
; };
25 #pragma options align=mac68k
26 struct s3
{ short f1
; int f2
; };
27 #pragma options align=reset
28 struct s4
{ short f1
; int f2
; };
30 #pragma options align=mac68k foo /* { dg-warning "junk at end of '#pragma options'" } */
32 /* Segment pragmas don't do anything anymore. */
39 int x
, z
; /* { dg-warning "unused variable" } */
42 if (sizeof (struct s1
) != 6)
44 if (sizeof (struct s2
) != 8)
46 if (sizeof (struct s3
) != 6)
48 if (sizeof (struct s4
) != 8)
57 /* Trying to match on '(' or ')' gives regexp headaches, use . instead. */
58 #pragma unused /* { dg-error "missing '.' after '#pragma unused" } */
59 #pragma unused (a /* { dg-error "missing '.' after '#pragma unused" } */
60 #pragma unused (b) foo /* { dg-warning "junk at end of '#pragma unused'" } */