PR target/83368
[official-gcc.git] / gcc / testsuite / gcc.target / sh / pr54685.c
blobed84a3296ba8f4f72e48e249d346e429b59c9978
1 /* Check that a comparison 'unsigned int <= 0x7FFFFFFF' results in code
2 utilizing the cmp/pz instruction. */
3 /* { dg-do compile } */
4 /* { dg-options "-O1" } */
5 /* { dg-final { scan-assembler-not "not\[ \t\]" } } */
6 /* { dg-final { scan-assembler-times "cmp/pz" 7 } } */
7 /* { dg-final { scan-assembler-times "shll" 1 } } */
8 /* { dg-final { scan-assembler-times "movt" 4 } } */
10 int
11 test_00 (unsigned int a)
13 return !(a > 0x7FFFFFFF);
16 int
17 test_01 (unsigned int a)
19 return !(a > 0x7FFFFFFF) ? -5 : 10;
22 int
23 test_02 (unsigned int a)
25 /* 1x shll, 1x movt */
26 return a >= 0x80000000;
29 int
30 test_03 (unsigned int a)
32 return a >= 0x80000000 ? -5 : 10;
35 int
36 test_04 (unsigned int a)
38 return a <= 0x7FFFFFFF;
41 int
42 test_05 (unsigned int a)
44 return a <= 0x7FFFFFFF ? -5 : 10;
47 int
48 test_06 (unsigned int a)
50 return a < 0x80000000;
53 int
54 test_07 (unsigned int a)
56 return a < 0x80000000 ? -5 : 10;