Debian Codegraph @

gcc/testsuite/gcc.target/sh/pr53976-1.c

raw
1 /* Check that the SH specific sh_optimize_sett_clrt RTL optimization pass
2 works as expected. */
3 /* { dg-do compile } */
4 /* { dg-options "-O2" } */
5 /* { dg-final { scan-assembler-times "clrt" 2 } } */
6 /* { dg-final { scan-assembler-times "sett" 1 } } */
7
8 long long
9 test_00 (long long a, long long b, long long c, int d)
10 {
11 /* One of the blocks should have a clrt and the other one should not. */
12 if (d > 5)
13 return a + b;
14 else
15 return a + c;
16 }
17
18 long long
19 test_01 (long long a, long long b)
20 {
21 /* Must see a clrt because T bit is undefined at function entry. */
22 return a + b;
23 }
24
25 int
26 test_02 (int a, int b, int c, int d)
27 {
28 /* One of the blocks should have a sett and the other one should not. */
29 if (d > 4)
30 return a + b + 1;
31 else
32 return a + c + 1;
33 }