]> matita.cs.unibo.it Git - pkg-cerco/acc.git/blob - tests/GCCTestSuite/fold-mod-1.c
Package description and copyright added.
[pkg-cerco/acc.git] / tests / GCCTestSuite / fold-mod-1.c
1 /* { dg-do compile } */
2 /* { dg-options "-fdump-tree-gimple" } */
3
4 #define ABS(x) (x > 0 ? x : -x)
5
6 unsigned int f (unsigned int a) {
7         /* (unsigned)-8 is not a power of 2.  */
8         return a % -8;
9 }
10
11 int g (int b) {
12         return ABS (b) % -8;
13 }
14
15 int h (int c) {
16         return ABS (c) % 8;
17 }
18
19 unsigned int k (unsigned int d) {
20         return d % 8;
21 }
22
23 /* { dg-final { scan-tree-dump "a % (4294967288|0fffffff8)" "gimple" } } */
24 /* { dg-final { scan-tree-dump-times " & 7" 3 "gimple" } } */
25 /* { dg-final { cleanup-tree-dump "gimple" } } */