Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/csel_bfx_2.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
3 unsigned
4 f1(int t, int t1)
5 {
6 int tt = 0;
7 if(t)
8 tt = (t1&0x8)!=0;
9 return tt;
10 }
11 struct f
12 {
13 unsigned t:3;
14 unsigned t1:4;
15 };
16 unsigned
17 f2(int t, struct f y)
18 {
19 int tt = 0;
20 if(t)
21 tt = y.t1;
22 return tt;
23 }
24 /* Both f1 and f2 should produce a csel and not a cbz on the argument. */
25 /* { dg-final { scan-assembler-times "csel\t" 2 } } */
26 /* { dg-final { scan-assembler-times "ubfx\t" 2 } } */
27 /* { dg-final { scan-assembler-not "cbz\t" } } */