Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.dg / fold-modpow2-2.c
blob803d52754766ee418d6420048bfd52e1664f02ea
1 /* PR tree-optimization/99079 */
2 /* { dg-do compile { target { lp64 || ilp32 } } } */
3 /* { dg-options "-O2 -fdump-tree-optimized" } */
5 unsigned int
6 foo1 (unsigned int a, unsigned int b)
8 return a % (1 << b);
11 int
12 foo2 (int b)
14 return 371 % (1U << b);
17 long long
18 foo3 (int b)
20 return 371LL % (1U << b);
23 unsigned long long
24 foo4 (unsigned long long a, int b)
26 return a % (1U << b);
29 unsigned
30 foo5 (unsigned a, int b)
32 return a % (unsigned) (1ULL << b);
35 int
36 foo6 (int b)
38 return 371 % (int) (1ULL << b);
41 long long
42 foo7 (int b)
44 return 371LL % (1 << b);
47 /* { dg-final { scan-tree-dump-not " % " "optimized" } } */