2018-02-09 Sebastian Perta <sebastian.perta@renesas.com>
[official-gcc.git] / gcc / testsuite / gcc.target / sh / pr51244-4.c
blob9d9361c2dbfc959ac037605f684b0fff3478cefe
1 /* Check that storing the (negated) T bit as all ones or zeros in a reg
2 uses the subc instruction. */
3 /* { dg-do compile } */
4 /* { dg-options "-O1 -mbranch-cost=2" } */
5 /* { dg-final { scan-assembler-not "movt|tst|negc|movrt" } } */
6 /* { dg-final { scan-assembler-times "subc" 3 } } */
7 /* { dg-final { scan-assembler-times "not\t" 1 } } */
8 /* { dg-final { scan-assembler-times "shll" 1 } } */
9 /* { dg-final { scan-assembler-not "cmp/gt" } } */
11 int
12 test_00 (int x, int y)
14 /* 1x subc, 1x not */
15 return x != y ? -1 : 0;
18 int
19 test_01 (int x, int y)
21 /* 1x subc */
22 return x == y ? -1 : 0;
25 int
26 test_02 (int x)
28 /* 1x shll, 1x subc */
29 return 0 <= x ? 0 : -1;