Debian Codegraph @

gcc/testsuite/gcc.target/arm/bics_4.c

raw
1 /* { dg-do run } */
2 /* { dg-options "-O2 --save-temps -fno-inline" } */
3 /* { dg-require-effective-target arm32 } */
4
5 extern void abort (void);
6
7 int
8 bics_si_test1 (int a, int b, int c)
9 {
10 if ((a & b) == a)
11 return a;
12 else
13 return c;
14 }
15
16 int
17 bics_si_test2 (int a, int b, int c)
18 {
19 if ((a & b) == b)
20 return b;
21 else
22 return c;
23 }
24
25 int
26 main ()
27 {
28 int x;
29 x = bics_si_test1 (0xf00d, 0xf11f, 0);
30 if (x != 0xf00d)
31 abort ();
32
33 x = bics_si_test1 (0xf11f, 0xf00d, 0);
34 if (x != 0)
35 abort ();
36
37 x = bics_si_test2 (0xf00d, 0xf11f, 0);
38 if (x != 0)
39 abort ();
40
41 x = bics_si_test2 (0xf11f, 0xf00d, 0);
42 if (x != 0xf00d)
43 abort ();
44
45 return 0;
46 }
47
48 /* { dg-final { scan-assembler-times "bics\tr\[0-9\]+, r\[0-9\]+, r\[0-9\]+" 2 } } */