]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/tree-ssa/stdarg-7.c
Fix profile update in tree_transform_and_unroll_loop
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / stdarg-7.c
1 /* PR target/64979 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-stdarg" } */
4
5 #include <stdarg.h>
6
7 void bar (int x, va_list *ap);
8
9 void
10 foo (int x, ...)
11 {
12 va_list ap;
13 int n;
14
15 va_start (ap, x);
16 n = va_arg (ap, int);
17 bar (x, (va_list *) ((n == 0) ? ((void *) 0) : &ap));
18 va_end (ap);
19 }
20
21 /* { dg-final { scan-tree-dump "foo: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" } } */