1 /* { dg-do link } */
2 /* { dg-options "-O2" } */
3
4 extern void link_error (void);
5
6 void
f2(int c,int b)7 f2 (int c, int b)
8 {
9 int s = 0;
10 if (c == 0)
11 s += 1;
12 else if (c < 1)
13 s -= 1;
14 /* s in [-1, 1]. */
15 b = (b & 1) + 1;
16 /* b in range [1, 2]. */
17 b = s << b;
18 /* b in range [-4, 4]. */
19 if (b == -5 || b == 5)
20 link_error ();
21 }
22
23 void
f3(int s,int b)24 f3 (int s, int b)
25 {
26 if (s >> 3 == -2)
27 {
28 /* s in range [-16, -9]. */
29 b = (b & 1) + 1;
30 /* b in range [1, 2]. */
31 b = s << b;
32 /* b in range [bmin << smax, bmax << smin],
33 == [-16 << 2, -9 << 1]
34 == [-64, -18]. */
35 if (b == -65 || b == -17)
36 link_error ();
37 }
38 }
39
40 void
f4(unsigned int s,unsigned int b)41 f4 (unsigned int s, unsigned int b)
42 {
43 s |= ~0xffU;
44 /* s in [0xffffff00, 0xffffffff]. */
45 b = (b & 1) + 1;
46 /* b in [1, 2]. */
47 b = s << b;
48 /* s in [0xfffffc00, 0xfffffffe]. */
49 if (b == ~0x3ffU - 1 || b == ~0x1U + 1)
50 link_error ();
51 }
52
53 int
main()54 main ()
55 {
56 return 0;
57 }
58