diff options
Diffstat (limited to 'ld/testsuite/ld-selective/4.cc')
-rw-r--r-- | ld/testsuite/ld-selective/4.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ld/testsuite/ld-selective/4.cc b/ld/testsuite/ld-selective/4.cc new file mode 100644 index 00000000000..9df26ac872c --- /dev/null +++ b/ld/testsuite/ld-selective/4.cc @@ -0,0 +1,28 @@ +struct A +{ + virtual void foo(); + virtual void bar(); +}; + +void A::foo() { } // loose +void A::bar() { } // keep + +struct B : public A +{ + virtual void foo(); +}; + +void B::foo() { } // loose + +void _start() __asm__("_start"); // keep + +A a; // keep +B b; +A *getme() { return &a; } // keep + +void _start() +{ + getme()->bar(); +} + +extern "C" void __main() { } |