source: trunk/binutils/ld/testsuite/ld-selective/3.cc

Last change on this file was 610, checked in by bird, 22 years ago

This commit was generated by cvs2svn to compensate for changes in r609,
which included commits to RCS files with non-trunk default branches.

  • Property cvs2svn:cvs-rev set to 1.1.1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 834 bytes
Line 
1struct A
2{
3 virtual void foo();
4 virtual void bar();
5};
6
7void A::foo() { } // keep
8void A::bar() { } // lose
9
10struct B : public A
11{
12 virtual void foo();
13};
14
15void B::foo() { } // keep
16
17void _start() __asm__("_start"); // keep
18void start() __asm__("start"); // some toolchains use this name.
19
20A a; // keep
21B b;
22A *getme() { return &a; } // keep
23
24void _start()
25{
26 getme()->foo();
27#ifdef __GNUC__
28#if (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
29// gcc-2.95.2 gets this test wrong, and loses B::foo().
30// Cheat. After all, we aren't trying to test the compiler here.
31 b.foo();
32#endif
33#endif
34}
35
36void start ()
37{
38 _start ();
39}
40
41// In addition, keep A's virtual table.
42
43// We'll wind up keeping `b' and thus B's virtual table because
44// `a' and `b' are both referenced from the constructor function.
45
46extern "C" void __main() { }
Note: See TracBrowser for help on using the repository browser.