1 /* PR target/44575 */ 2 3 #include <stdarg.h> 4 5 int fails = 0; 6 struct S { float a[3]; }; 7 struct S a[5]; 8 9 void check(int z,...)10check (int z, ...) 11 { 12 struct S arg, *p; 13 va_list ap; 14 int j = 0, k = 0; 15 int i; 16 va_start (ap, z); 17 for (i = 2; i < 4; ++i) 18 { 19 p = 0; 20 j++; 21 k += 2; 22 switch ((z << 4) | i) 23 { 24 case 0x12: 25 case 0x13: 26 p = &a[2]; 27 arg = va_arg (ap, struct S); 28 break; 29 default: 30 ++fails; 31 break; 32 } 33 if (p && p->a[2] != arg.a[2]) 34 ++fails; 35 if (fails) 36 break; 37 } 38 va_end (ap); 39 } 40 41 int main()42main () 43 { 44 a[2].a[2] = -49026; 45 check (1, a[2], a[2]); 46 if (fails) 47 abort (); 48 return 0; 49 } 50