Commit ca2bfbc2 by Dominik Vogt Committed by Andreas Krebbel

S/390: PR 69625: Add test case

gcc/testsuite/ChangeLog

	PR target/69625
	* gcc.target/s390/pr69625.c: Add test case.

From-SVN: r233546
parent 7082a762
2016-02-19 Dominik Vogt <vogt@linux.vnet.ibm.com>
PR target/69625
* gcc.target/s390/pr69625.c: Add test case.
2016-02-18 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR testsuite/68580
......
/* Test for PR 69625; make sure that a leaf vararg function does not overwrite
the caller's r6. */
/* { dg-do run } */
/* { dg-options "-O2" } */
extern void abort (void);
__attribute__ ((noinline))
int
foo (int x, ...)
{
__builtin_va_list vl;
int i;
__asm__ __volatile__ ("lhi %%r6,1" : : : "r6");
__builtin_va_start(vl, x);
for (i = 2; i <= 6; i++)
x += __builtin_va_arg(vl, int);
__builtin_va_end (vl);
return x;
}
__attribute__ ((noinline))
void
bar (int r2, int r3, int r4, int r5, int r6)
{
foo (r2, r3, r4, r5, r6);
if (r6 != 6)
abort ();
}
int
main (void)
{
bar (2, 3, 4, 5, 6);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment