Debian Codegraph @

gcc/testsuite/g++.dg/lto/pr52605_0.C

raw
1 // { dg-lto-do link }
2 // { dg-lto-options {{-flto -g}} }
3
4 extern "C" void abort (void);
5
6 class A
7 {
8 public:
9 virtual int foo (int i);
10 };
11
12 int A::foo (int i)
13 {
14 return i + 1;
15 }
16
17 int __attribute__ ((noinline,noclone)) get_input(void)
18 {
19 return 1;
20 }
21
22 int main (int argc, char *argv[])
23 {
24
25 class B : public A
26 {
27 public:
28 int bar (int i)
29 {
30 return foo (i) + 2;
31 }
32 };
33 class B b;
34
35 if (b.bar (get_input ()) != 4)
36 abort ();
37 return 0;
38 }
39