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 #pragma mark hey hey ho
10 /* The options pragma used to do a lot, now it's only for emulating
11 m68k alignment rules in structs. */
13 #pragma options 23 /* { dg-error "malformed '#pragma options'" } */
14 #pragma options align /* { dg-error "malformed '#pragma options'" } */
15 #pragma options align mac68k /* { dg-error "malformed '#pragma options'" } */
16 #pragma options align=45 /* { dg-error "malformed '#pragma options'" } */
17 #pragma options align=foo /* { dg-error "malformed '#pragma options align" } */
19 #pragma options align=mac68k
20 struct s1
{ short f1
; int f2
; };
21 #pragma options align=power
22 struct s2
{ short f1
; int f2
; };
23 #pragma options align=mac68k
24 struct s3
{ short f1
; int f2
; };
25 #pragma options align=reset
26 struct s4
{ short f1
; int f2
; };
28 #pragma options align=mac68k foo /* { dg-warning "junk at end of '#pragma options'" } */
30 /* Segment pragmas don't do anything anymore. */
37 int x
, z
; /* { dg-warning "unused variable" } */
40 if (sizeof (struct s1
) != 6)
42 if (sizeof (struct s2
) != 8)
44 if (sizeof (struct s3
) != 6)
46 if (sizeof (struct s4
) != 8)
55 /* Trying to match on '(' or ')' gives regexp headaches, use . instead. */
56 #pragma unused /* { dg-error "missing '.' after '#pragma unused" } */
57 #pragma unused (a /* { dg-error "missing '.' after '#pragma unused" } */
58 #pragma unused (b) foo /* { dg-warning "junk at end of '#pragma unused'" } */