Add new test to verify that the array index, limit, and stride are
[official-gcc.git] / gcc / testsuite / gcc.dg / pr52691.c
blob7a2d7d8ebb17ce52618c65f2fb4cbd52166b5572
1 /* PR middle-end/52691 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-optimized" } */
5 #include <stdarg.h>
7 int
8 foo (int a, ...)
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;
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 /* { dg-final { cleanup-tree-dump "optimized" } } */