aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/csky/cse-cc.c
blob: b97a16e78c4e6e53d2d609935038fd12133e9b57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do compile } */
/* { dg-csky-options "-O2" } */

/* Test that the two comparisons are combined.  This was formerly handled
   by a no-longer-present target-specific pass and is now supposed to
   be handled by generic CSE.  */

int e1, e2;

void func (int a, int b, int c, int d, int f, int g)
{
  e1 = a > b ? f : g;
  e2 = a > b ? c : d;

  return;
}

/* { dg-final { scan-assembler-times "cmp" 1 } } */