2018-04-30 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / vrp95.c
blobb894e24d795c9c1ed7758e3050b458c4f39d4145
1 /* PR tree-optimization/64322 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-vrp1" } */
5 extern void link_error ();
6 extern void required_check ();
8 long long int
9 foo (long long int x)
11 x >>= sizeof (long long int) * __CHAR_BIT__ - 1;
12 if (x != 0 && x != -1)
13 link_error ();
14 return x;
17 unsigned long long int
18 bar (unsigned long long int x)
20 x >>= sizeof (long long int) * __CHAR_BIT__ - 1;
21 if (x != 0 && x != 1)
22 link_error ();
23 return x;
26 long long int
27 baz (long long int x)
29 x = (x >> sizeof (long long int) * __CHAR_BIT__ - 1) << 1;
30 x = x / 0x100000000LL;
31 if (x != 0)
32 link_error ();
33 return x;
36 unsigned long long int
37 range (unsigned long long int x, int y)
39 y &= 3;
40 x >>= sizeof (long long int) * __CHAR_BIT__ - 1 - y;
41 if (x > 15)
42 link_error ();
43 if (x == 15)
44 required_check ();
45 return x;
48 /* { dg-final { scan-tree-dump-not "link_error" "vrp1" } } */
49 /* { dg-final { scan-tree-dump "required_check" "vrp1" } } */