2018-04-09 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / fold-minus-6.c
blob153545266d81472744ce0fdc946a7770a20bb3fe
1 /* { dg-do compile } */
2 /* { dg-options "-O -fdump-tree-cddce1" } */
4 int
5 fn1 (int x)
7 return 42L - (42 / x) * x;
10 long
11 fn2 (int x)
13 return 42L - (42 / x) * x;
16 int
17 fn3 (long int x)
19 return 42L - (42 / x) * x;
22 int
23 fn4 (unsigned int a, int b)
25 return a - (unsigned) ((a / b) * b);
28 int
29 fn5 (int a, unsigned int b)
31 return a - ((a / b) * b);
34 unsigned int
35 fn6 (int a, int b)
37 return a - ((a / b) * b);
40 /* { dg-final { scan-tree-dump-not " / " "cddce1" } } */
41 /* { dg-final { scan-tree-dump-not " - " "cddce1" } } */
42 /* { dg-final { scan-tree-dump-not " \\+ " "cddce1" } } */