Add __builtion_unreachable to vector::size(), vector::capacity()
[official-gcc.git] / gcc / testsuite / gcc.dg / pr46309.c
blob615d6574ef97ed393f3ab2ba58e71556d18b1ef5
1 /* PR tree-optimization/46309 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-reassoc-details --param logical-op-non-short-circuit=1" } */
5 int
6 f1 (int a)
8 int v1 = (a == 3);
9 int v2 = (a == 1);
10 int v3 = (a == 4);
11 int v4 = (a == 2);
12 return v1 || v2 || v3 || v4;
15 int
16 f2 (int a)
18 int v1 = (a == 1);
19 int v2 = (a == 2);
20 int v3 = (a == 3);
21 int v4 = (a == 4);
22 return v1 || v2 || v3 || v4;
25 int
26 f3 (int a)
28 int v1 = (a == 3);
29 int v2 = (a == 1);
30 return v1 || v2;
33 int
34 f4 (int a)
36 int v1 = (a == 1);
37 int v2 = (a == 2);
38 return v1 || v2;
41 int
42 f5 (unsigned int a)
44 int v1 = (a <= 31);
45 int v2 = (a >= 64 && a <= 95);
46 return v1 || v2;
49 int
50 f6 (unsigned int a)
52 int v1 = (a <= 31);
53 int v2 = (a >= 64 && a <= 95);
54 int v3 = (a >= 128 && a <= 159);
55 int v4 = (a >= 192 && a <= 223);
56 return v1 || v2 || v3 || v4;
59 /* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.1, 1. and -.2, 2. and -.3, 3. and -.4, 4.\[\n\r\]* into" 2 "reassoc1" } } */
60 /* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.1, 1. and -.3, 3.\[\n\r\]* into" 1 "reassoc1" } } */
61 /* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.1, 1. and -.2, 2.\[\n\r\]* into" 1 "reassoc1" } } */
62 /* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.0, 31. and -.64, 95.\[\n\r\]* into" 2 "reassoc1" } } */
63 /* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.128, 159. and -.192, 223.\[\n\r\]* into" 1 "reassoc1" } } */
64 /* { dg-final { scan-tree-dump-times "Optimizing range tests \[^\r\n\]*_\[0-9\]* -.0, 0. and -.128, 128.\[\n\r\]* into" 1 "reassoc2" } } */