| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-std=c23 -Wunused-value" } */ |
| 3 |
|
| 4 |
#include <stdarg.h> |
| 5 |
|
| 6 |
const unsigned char a[] = { |
| 7 |
#embed __FILE__ limit (128) |
| 8 |
}; |
| 9 |
|
| 10 |
int |
| 11 |
foo (...) |
| 12 |
{ |
| 13 |
va_list ap; |
| 14 |
va_start (ap); |
| 15 |
for (int i = 0; i < 128; ++i) |
| 16 |
if (va_arg (ap, int) != a[i]) |
| 17 |
{ |
| 18 |
va_end (ap); |
| 19 |
return 1; |
| 20 |
} |
| 21 |
va_end (ap); |
| 22 |
return 0; |
| 23 |
} |
| 24 |
|
| 25 |
int b, c; |
| 26 |
|
| 27 |
int |
| 28 |
main () |
| 29 |
{ |
| 30 |
if (foo ( |
| 31 |
#embed __FILE__ limit (128) |
| 32 |
)) |
| 33 |
__builtin_abort (); |
| 34 |
b = ( |
| 35 |
#embed __FILE__ limit (128) prefix (c = 2 * ) suffix ( + 6) /* { dg-warning "right-hand operand of comma expression has no effect" } */ |
| 36 |
); |
| 37 |
if (b != a[127] + 6 || c != 2 * a[0]) |
| 38 |
__builtin_abort (); |
| 39 |
} |