1 /* { dg-do run } */ 2 /* { dg-require-alias "" } */ 3 4 #include <typeinfo> 5 6 struct Klass 7 { 8 int implementation () const; 9 virtual int magic () const; 10 }; 11 implementation(void)12int Klass::implementation (void) const 13 { 14 return 0; 15 } 16 17 int Klass::magic () const 18 __attribute__ ((alias ("_ZNK5Klass14implementationEv"))); 19 20 int __attribute__ ((noinline)) Foo(Klass const * ptr)21 Foo (Klass const *ptr) 22 { 23 if (ptr->magic () != 0) 24 return 1; 25 26 if (typeid (*ptr) != typeid (Klass)) 27 return 2; 28 29 return 0; 30 } 31 main()32int main () 33 { 34 Klass obj; 35 36 return Foo (&obj); 37 } 38