1 /* Test QBBC recognition */
2
3 /* { dg-do run } */
4 /* { dg-options "-O1" } */
5
6 /* -O1 in the options is significant. Without it bit-check-and-branch
7 operation may not be optimized to QBBC. */
8
9 extern void abort (void);
10
11 unsigned int
12 test_qbbc_reg (unsigned int a, unsigned int b, unsigned int val)
13 {
14 if (!(val & (1 << 19)))
15 return a;
16 return b;
17 }
18
19 int
20 main (int argc, char** argv)
21 {
22 if (test_qbbc_reg (101, 505, (1u << 19)) != 505)
23 abort();
24 if (test_qbbc_reg (101, 505, (1u << 18)) != 101)
25 abort();
26
27 return 0;
28 }
29