OSDN Git Service

2010-03-31 Martin Jambor <mjambor@suse.cz>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / torture / reassoc-1.c
1 /* { dg-do run } */
2
3 int x;
4
5 int __attribute__((noinline))
6 foo(int a, int b, int w)
7 {
8   int tmp1 = a * w;
9   int tmp2 = b * w;
10   x = tmp1;
11   return tmp1 + tmp2;
12 }
13
14 extern void abort (void);
15
16 int main()
17 {
18   if (foo(1, 2, 3) != 9)
19     abort ();
20   if (x != 3)
21     abort ();
22   return 0;
23 }
24