OSDN Git Service

2005-12-11 Andrew Pinski <pinskia@physics.uc.edu>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / objc.dg / encode-8.m
1 /* { dg-options "-fgnu-runtime" } */
2 /* { dg-do run } */
3
4 #include <objc/encoding.h>
5 #include <stdlib.h>
6
7 union f
8 {
9   char i;
10   double f1;
11   short t;
12 };
13
14 union g
15 {
16   int i;
17 };
18
19
20 int main(void)
21 {
22   if (objc_sizeof_type (@encode (union f)) != sizeof(union f))
23    abort ();
24   if (objc_alignof_type (@encode (union f)) != __alignof__(union f))
25    abort ();
26   if (objc_sizeof_type (@encode (union g)) != sizeof(union g))
27    abort ();
28   if (objc_alignof_type (@encode (union g)) != __alignof__(union g))
29    abort ();
30   return 0;
31 }