8sa1-gcc/gcc/testsuite/gcc.c-torture/execute/20050124-1.c
Jakub Jelinek b8e48b9803 re PR rtl-optimization/19579 (-march=i686 generates a bogus program for x86*)
PR rtl-optimization/19579
	* ifcvt.c (noce_try_cmove_arith): If emitting instructions to set up
	both A and B, see if they don't clobber registers the other expr uses.

	* gcc.c-torture/execute/20050124-1.c: New test.

From-SVN: r94234
2005-01-26 00:09:10 +01:00

42 lines
525 B
C

/* PR rtl-optimization/19579 */
extern void abort (void);
int
foo (int i, int j)
{
int k = i + 1;
if (j)
{
if (k > 0)
k++;
else if (k < 0)
k--;
}
return k;
}
int
main (void)
{
if (foo (-2, 0) != -1)
abort ();
if (foo (-1, 0) != 0)
abort ();
if (foo (0, 0) != 1)
abort ();
if (foo (1, 0) != 2)
abort ();
if (foo (-2, 1) != -2)
abort ();
if (foo (-1, 1) != 0)
abort ();
if (foo (0, 1) != 2)
abort ();
if (foo (1, 1) != 3)
abort ();
return 0;
}