OSDN Git Service

2011-10-19 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / torture / pr38405.c
1 /* { dg-do run } */
2
3 extern void abort ();
4 extern int printf (char *__format, ...);
5
6 struct vpiBinaryConst {
7  int signed_flag :1;
8  int sized_flag :1;
9 };
10
11 int binary_get(int code, struct vpiBinaryConst *rfp)
12 {
13  switch (code) {
14   case 1:
15    return rfp->signed_flag ? 1 : 0;
16   default:
17    printf("error: %d not supported\n", code);
18    return code;
19  }
20 }
21
22 int main(void)
23 {
24  struct vpiBinaryConst x={1,0};
25  int y=binary_get(1, &x);
26  if (y!=1)
27    abort ();
28  return 0;
29 }