comparison gcc/testsuite/g++.dg/ipa/devirt-44.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* { dg-do compile } */ 1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fno-ipa-cp -fdump-ipa-inline-details -fno-early-inlining" } */ 2 /* { dg-options "-O3 -fno-ipa-cp -fdump-ipa-inline-details -fno-early-inlining" } */
3 struct A { 3 struct A {
4 virtual int foo () {return 1;} 4 virtual int foo () {return 1;}
5 int wrapfoo () {foo();} 5 void wrapfoo () {foo();}
6 A() {wrapfoo();} 6 A() {wrapfoo();}
7 }; 7 };
8 struct B:A {virtual int foo () {return 2;}}; 8 struct B:A {virtual int foo () {return 2;}};
9 9
10 void dostuff(struct A *); 10 void dostuff(struct A *);
15 dostuff (a); 15 dostuff (a);
16 if (a->foo ()!= 2) 16 if (a->foo ()!= 2)
17 __builtin_abort (); 17 __builtin_abort ();
18 } 18 }
19 19
20 main() 20 int main()
21 { 21 {
22 struct B a; 22 struct B a;
23 dostuff (&a); 23 dostuff (&a);
24 test (&a); 24 test (&a);
25 } 25 }