diff options
Diffstat (limited to 'binutils-2.21/ld/testsuite/ld-selective/5.cc')
-rw-r--r-- | binutils-2.21/ld/testsuite/ld-selective/5.cc | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/binutils-2.21/ld/testsuite/ld-selective/5.cc b/binutils-2.21/ld/testsuite/ld-selective/5.cc new file mode 100644 index 0000000..2c974d9 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-selective/5.cc @@ -0,0 +1,38 @@ +struct A +{ + virtual void foo(); + virtual void bar(); +}; + +void A::foo() { } // lose +void A::bar() { } // keep + +struct B : public A +{ + virtual void foo(); +}; + +void B::foo() { } // lose + +void _start() __asm__("_start"); // keep +void start() __asm__("start"); // some toolchains use this name. + +A a; // keep +B b; +A *getme() { return &a; } // keep + +extern B* dropme2(); +void dropme1() { dropme2()->foo(); } // lose +B *dropme2() { return &b; } // lose + +void _start() +{ + getme()->bar(); +} + +void start () +{ + _start (); +} + +extern "C" void __main() { } |