OSDN Git Service

Add NIOS2 support. Code from SourceyG++.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / tree-ssa / reassoc-14.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-reassoc1" } */
3
4 int test1 (int x, int y, int z, int weight)
5 {
6   int tmp1 = x * weight;
7   int tmp2 = y * weight;
8   int tmp3 = (x - y) * weight;
9   return tmp1 + (tmp2 + tmp3);
10 }
11
12 int test2 (int x, int y, int z, int weight)
13 {
14   int tmp1 = x * weight;
15   int tmp2 = y * weight * weight;
16   int tmp3 = z * weight * weight * weight;
17   return tmp1 + tmp2 + tmp3;
18 }
19
20 /* There should be one multiplication left in test1 and three in test2.  */
21
22 /* { dg-final { scan-tree-dump-times "\\\*" 4 "reassoc1" } } */
23 /* { dg-final { cleanup-tree-dump "reassoc1" } } */