1 /* PR middle-end/52691 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 
5 #include <stdarg.h>
6 
7 int
foo(int a,...)8 foo (int a, ...)
9 {
10   int b = 0, c = 0;
11   va_list ap;
12   va_start (ap, a);
13   if (a > 1)
14     b = va_arg (ap, double);
15   if (a > 2)
16     c = va_arg (ap, long long);
17   va_end (ap);
18   return a + b + c;
19 }
20 
21 /* { dg-final { scan-tree-dump "__builtin_next_arg" "optimized" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
22 /* { dg-final { scan-tree-dump "__builtin_next_arg" "optimized" { target { powerpc*-*-darwin* powerpc*-*-aix* } } } } */
23 /* { dg-final { scan-tree-dump "__builtin_next_arg" "optimized" { target { powerpc*-*-linux* && lp64 } } } } */
24