aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/vax/compare-add-zero.c
blob: 97d4c535c73fafe752495de59045fb17505c50fe (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
/* { dg-do compile } */
/* { dg-options "" } */

int
compare_add (int x, int y)
{
  int z;

  z = x + y;
  if (z < 0)
    return z;
  else
    return z + 2;
}

/* Expect assembly like:

	addl3 4(%ap),8(%ap),%r0
	jlss .L1
	addl2 $2,%r0
.L1:

A reverse branch may be used at some optimization levels.  */

/* Make sure the comparison is made against 0 rather than -1.  */
/* { dg-final { scan-assembler-not "\tj(gtr|leq) " } } */
/* { dg-final { scan-assembler "\tj(geq|lss) " } } */