gcc/testsuite/g++.dg/lto/20081118_0.C
raw| 1 | /* { dg-lto-do link } */ |
| 2 | /* { dg-require-effective-target fpic } */ |
| 3 | /* { dg-lto-options {{-fPIC -flto -flto-partition=1to1 -r -nostdlib}} } */ |
| 4 | /* { dg-extra-ld-options "-flinker-output=nolto-rel" } */ |
| 5 | |
| 6 | /* We used to ICE because of dangling pointers. */ |
| 7 | |
| 8 | class object |
| 9 | { |
| 10 | public: |
| 11 | virtual ~object() {} |
| 12 | }; |
| 13 | |
| 14 | class foo : public object |
| 15 | { |
| 16 | virtual int method(void); |
| 17 | }; |
| 18 | |
| 19 | int |
| 20 | foo::method(void) |
| 21 | { |
| 22 | return 0; |
| 23 | } |