aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/sh/pr54685.c
blob: 111a12013d6949b40e16339f2f716bb78cfb3f87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* Check that a comparison 'unsigned int <= 0x7FFFFFFF' results in code
   utilizing the cmp/pz instruction.  */
/* { dg-do compile }  */
/* { dg-options "-O1" } */
/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } }  */
/* { dg-final { scan-assembler-not "not\[ \t\]" } } */
/* { dg-final { scan-assembler-times "cmp/pz" 7 } } */
/* { dg-final { scan-assembler-times "shll" 1 } } */
/* { dg-final { scan-assembler-times "movt" 4 } } */

int
test_00 (unsigned int a)
{
  return !(a > 0x7FFFFFFF);
}

int
test_01 (unsigned int a)
{
  return !(a > 0x7FFFFFFF) ? -5 : 10;
}

int
test_02 (unsigned int a)
{
  /* 1x shll, 1x movt  */
  return a >= 0x80000000;
}

int
test_03 (unsigned int a)
{
  return a >= 0x80000000 ? -5 : 10;
}

int
test_04 (unsigned int a)
{
  return a <= 0x7FFFFFFF;
}

int
test_05 (unsigned int a)
{
  return a <= 0x7FFFFFFF ? -5 : 10;
}

int
test_06 (unsigned int a)
{
  return a < 0x80000000;
}

int
test_07 (unsigned int a)
{
  return a < 0x80000000 ? -5 : 10;
}