* ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch
[official-gcc.git] / gcc / testsuite / gcc.target / s390 / pr69625.c
blobf717183d3965f30ddaada63edb62550d7939c363
1 /* Test for PR 69625; make sure that a leaf vararg function does not overwrite
2 the caller's r6. */
3 /* { dg-do run } */
4 /* { dg-options "-O2" } */
6 extern void abort (void);
8 __attribute__ ((noinline))
9 int
10 foo (int x, ...)
12 __builtin_va_list vl;
13 int i;
15 __asm__ __volatile__ ("lhi %%r6,1" : : : "r6");
16 __builtin_va_start(vl, x);
17 for (i = 2; i <= 6; i++)
18 x += __builtin_va_arg(vl, int);
19 __builtin_va_end (vl);
21 return x;
24 __attribute__ ((noinline))
25 void
26 bar (int r2, int r3, int r4, int r5, int r6)
28 foo (r2, r3, r4, r5, r6);
29 if (r6 != 6)
30 abort ();
33 int
34 main (void)
36 bar (2, 3, 4, 5, 6);