aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/sh/pr51244-1.c
blob: 15e2ebd1bfc339dfa43419b108281d48f7c7a851 (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
/* Check that inverted conditional branch logic does not generate
   unnecessary explicit T bit extractions, inversions and 
   test instructions.  */
/* { dg-do compile }  */
/* { dg-options "-O1 -mbranch-cost=2" } */
/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */
/* { dg-final { scan-assembler-not "movt|tst|negc|extu" } } */

int
testfunc_00 (int a, int b, int c, int d)
{
  return (a != b || a != d) ? b : c;
}

int
testfunc_01 (int a, int b, int c, int d)
{
  return (a == b || a == d) ? b : c;
}

int
testfunc_02 (int a, int b, int c, int d)
{
  return (a == b && a == d) ? b : c;
}

int
testfunc_03 (int a, int b, int c, int d)
{
  return (a != b && a != d) ? b : c;
}