aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/sh/pr51244-5.c
blob: c0f05a105208cae4c76716cf1d9b1dafea3957e1 (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
/* Check that no unnecessary sign or zero extension insn is generated after
   a negc or movrt insn that stores the inverted T bit in a reg.  */
/* { dg-do compile }  */
/* { dg-options "-O2" } */
/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */
/* { dg-final { scan-assembler-not "extu|exts" } } */

int
test_00 (int a, int b, int* c, short* d, int x)
{
  *d = x != 0;
  *c = -1;

  if (x != 0)
    return a > 0;

  return 0;
}

unsigned char
test_01 (int x)
{
  if (x < 58 && x > 47)
    return 1;
  return 0;
}

char
test_02 (int x)
{
  if (x < 58 && x > 47)
    return 1;
  return 0;
}

unsigned short
test_03 (int x)
{
  if (x < 58 && x > 47)
    return 1;
  return 0;
}

short
test_04 (int x)
{
  if (x < 58 && x > 47)
    return 1;
  return 0;
}