Fix ICE in substring-handling building 502.gcc_r (PR 87562)
[official-gcc.git] / gcc / testsuite / gcc.dg / pr38245-2.c
blobbb2679c697c92ebaf5c335dca9adb22ac86c16e1
1 /* PR rtl-optimization/38245 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-optimized" } */
5 extern void link_error (void);
7 void
8 f1 (unsigned int a)
10 if (a != 28)
12 if (4 / a == 5)
13 link_error ();
17 void
18 f2 (unsigned int a)
20 if (4 / a == 5)
21 link_error ();
24 void
25 f3 (unsigned int a)
27 if (4 / (a & 0xff) == 5)
28 link_error ();
31 void
32 f4 (unsigned int a, unsigned int b)
34 if ((b & 3) / ((a & 0xff) + 1) == 5)
35 link_error ();
38 void
39 f5 (int a)
41 if (a != 28)
43 if (4 / a == 5)
44 link_error ();
48 void
49 f6 (int a)
51 if (4 / a == 5)
52 link_error ();
55 void
56 f7 (int a)
58 if (4 / (a & 0xff) == 5)
59 link_error ();
62 void
63 f8 (int a, int b)
65 if ((b & 3) / ((a & 0xff) + 1) == 5)
66 link_error ();
69 void
70 f9 (int a, int b)
72 if (b >= 4)
73 if ((a / b) == __INT_MAX__ / 2)
74 link_error ();
77 void
78 f10 (unsigned int a, unsigned int b)
80 if (b >= 16)
81 if ((a / b) == __INT_MAX__ / 4)
82 link_error ();
85 void
86 f11 (int a, int b)
88 if (b <= -32)
89 if ((a / b) == -__INT_MAX__ / 16)
90 link_error ();
93 void
94 f12 (int a, int b)
96 if (a >= -6 && a <= 4)
97 if ((a / b) == -7 || (a / b) == 7)
98 link_error ();
101 void
102 f13 (unsigned int a, unsigned int b)
104 if (a <= 4)
105 if ((a / b) == 5)
106 link_error ();
109 /* { dg-final { scan-tree-dump-not "link_error" "optimized" } } */