Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / reassoc-14.c
blob16ebc86133fac199d90a761679756219b7272b64
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-reassoc1" } */
4 unsigned int test1 (unsigned int x, unsigned int y, unsigned int z,
5 unsigned int weight)
7 unsigned int tmp1 = x * weight;
8 unsigned int tmp2 = y * weight;
9 unsigned int tmp3 = (x - y) * weight;
10 return tmp1 + (tmp2 + tmp3);
13 unsigned int test2 (unsigned int x, unsigned int y, unsigned int z,
14 unsigned int weight)
16 unsigned int tmp1 = x * weight;
17 unsigned int tmp2 = y * weight * weight;
18 unsigned int tmp3 = z * weight * weight * weight;
19 return tmp1 + tmp2 + tmp3;
22 /* There should be two multiplication left in test1 (inculding one generated
23 when converting addition to multiplication) and three in test2. */
25 /* { dg-final { scan-tree-dump-times "\\\*" 5 "reassoc1" } } */