OSDN Git Service

2008-05-04 Andy Hutchinson <hutchinsonandy@aim.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / torture / pr30375.c
1 /* { dg-do run } */
2 /* { dg-options "--param max-aliased-vops=0" } */
3
4 typedef struct _s {
5     int a;
6     int b;
7     int c;
8     int d;
9 } s;
10
11 extern void abort(void);
12
13 void __attribute__((noinline)) g(s *p)
14 {
15   if (p->d != 0)
16     abort ();
17 }
18
19 char *c = (void*)0;
20 void __attribute__((noinline)) f(void) { if (c) *c = 1; }
21
22 void test_signed_msg_encoding(void)
23 {
24     s signInfo = { sizeof(signInfo), 0 };
25
26     signInfo.b = 1;
27     signInfo.c = 0;
28     g(&signInfo);
29     signInfo.d = 1;
30     f();
31 }
32
33 int main()
34 {
35   test_signed_msg_encoding ();
36   test_signed_msg_encoding ();
37   return 0;
38 }