1 /* Darwin (Mac OS X) pragma exercises. */
3 /* { dg-do run { target *-*-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-warning "malformed '#pragma options'" } */
16 #pragma options align /* { dg-warning "malformed '#pragma options'" } */
17 #pragma options align natural /* { dg-warning "malformed '#pragma options'" } */
18 #pragma options align=45 /* { dg-warning "malformed '#pragma options'" } */
19 #pragma options align=foo /* { dg-warning "malformed '#pragma options align" } */
22 #pragma options align=mac68k
23 struct s1
{ short f1
; int f2
; };
25 #pragma options align=power
26 struct s2
{ short f1
; int f2
; };
28 #pragma options align=mac68k
29 struct s3
{ short f1
; int f2
; };
31 #pragma options align=reset
32 struct s4
{ short f1
; int f2
; };
34 #pragma options align=natural foo /* { dg-warning "junk at end of '#pragma options'" } */
35 /* { dg-warning "malformed '#pragma options align={mac68k|power|reset}', ignoring" "ignoring" { target *-*-* } .-1 } */
37 /* Segment pragmas don't do anything anymore. */
44 int x
, z
; /* { dg-warning "unused variable 'z'" } */
48 if (sizeof (struct s1
) != 6)
51 if (sizeof (struct s2
) != 8)
54 if (sizeof (struct s3
) != 6)
57 if (sizeof (struct s4
) != 8)
66 /* Trying to match on '(' or ')' gives regexp headaches, use . instead. */
67 #pragma unused /* { dg-warning "missing '.' after '#pragma unused" } */
68 #pragma unused (a /* { dg-warning "missing '.' after '#pragma unused" } */
69 #pragma unused (b) foo /* { dg-warning "junk at end of '#pragma unused'" } */