PR middle-end/30262
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 20061220-1.c
blob188f92cfc8edf2b7c85f2219ac18231dbfe5ce24
1 /* PR middle-end/30262 */
2 extern void abort (void);
4 int
5 foo (void)
7 unsigned int x = 0;
9 void nested (void)
11 x = 254;
14 nested ();
15 asm volatile ("" :: "r" (x));
16 asm volatile ("" :: "m" (x));
17 asm volatile ("" :: "mr" (x));
18 asm volatile ("" : "=r" (x) : "0" (x));
19 asm volatile ("" : "=m" (x) : "m" (x));
20 return x;
23 int
24 bar (void)
26 unsigned int x = 0;
28 void nested (void)
30 asm volatile ("" :: "r" (x));
31 asm volatile ("" :: "m" (x));
32 asm volatile ("" :: "mr" (x));
33 x += 4;
34 asm volatile ("" : "=r" (x) : "0" (x));
35 asm volatile ("" : "=m" (x) : "m" (x));
38 nested ();
39 return x;
42 int
43 baz (void)
45 unsigned int x = 0;
47 void nested (void)
49 void nested2 (void)
51 asm volatile ("" :: "r" (x));
52 asm volatile ("" :: "m" (x));
53 asm volatile ("" :: "mr" (x));
54 x += 4;
55 asm volatile ("" : "=r" (x) : "0" (x));
56 asm volatile ("" : "=m" (x) : "m" (x));
58 nested2 ();
59 nested2 ();
62 nested ();
63 return x;
66 int
67 main (void)
69 if (foo () != 254 || bar () != 4 || baz () != 8)
70 abort ();
71 return 0;