1 // { dg-do run { target arm*-*-* aarch64*-*-* i?86-*-* x86_64-*-* s390*-*-* alpha*-*-* ia64-*-* sparc*-*-* } } 2 // { dg-skip-if "" { arm_thumb1_ok } } 3 4 #include <stdarg.h> 5 6 extern "C" void abort (); 7 8 struct A { fA9 virtual void f (int, ...) {} 10 int i; 11 }; 12 13 struct B : virtual public A { 14 }; 15 16 struct C : public B { 17 C (); 18 virtual void f (int, ...); 19 }; 20 21 extern C* cp; 22 C()23C::C () { cp = this; } 24 f(int i,...)25void C::f (int i, ...) { 26 if (this != cp) 27 abort (); 28 va_list ap; 29 if (i != 3) 30 abort (); 31 va_start (ap, i); 32 if (va_arg (ap, int) != 7) 33 abort (); 34 va_end (ap); 35 } 36 37 C* cp = new C; 38 main()39int main () 40 { 41 cp->f (3, 7); 42 } 43