OSDN Git Service

2008-01-16 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.c-torture / execute / pr34768-2.c
1 int x;
2
3 int __attribute__((noinline)) foo (void)
4 {
5   x = -x;
6   return 0;
7 }
8 int __attribute__((const,noinline)) bar (void)
9 {
10   return 0;
11 }
12
13 int __attribute__((noinline))
14 test (int c)
15 {
16   int tmp = x;
17   int res = (c ? foo : bar) ();
18   return tmp + x + res;
19 }
20
21 extern void abort (void);
22 int main()
23 {
24   x = 1;
25   if (test (1) != 0)
26     abort ();
27   return 0;
28 }