Add GNU Free Documentation License
[binutils.git] / ld / testsuite / ld-srec / sr3.cc
blob4cde2dcbeb2c65509d9cd161f7a15b65356ec235
1 // This file is compiled and linked into the S-record format.
3 #define FOO_MSG_LEN 80
5 class Foo {
6 static int foos;
7 int i;
8 static const int len = FOO_MSG_LEN;
9 char message[len];
10 public:
11 static void init_foo ();
12 static int nb_foos() { return foos; }
13 Foo();
14 Foo( char* message);
15 Foo(const Foo&);
16 Foo & operator= (const Foo&);
17 ~Foo ();
20 static Foo static_foo( "static_foo");
22 int
23 main ()
25 Foo automatic_foo( "automatic_foo");
26 return 0;
29 void
30 terminate(void)
32 /* This recursive call prevents a compiler warning that the noreturn
33 function terminate actually does return. */
34 terminate ();
37 extern "C" {
38 void
39 __main ()
43 void
44 __builtin_delete ()
48 void
49 __builtin_new ()
53 void
54 __throw ()
58 void
59 __rethrow ()
63 void
64 __terminate ()
68 void *__eh_pc;
70 void ***
71 __get_dynamic_handler_chain ()
73 return 0;
76 void *
77 __get_eh_context ()
79 return 0;
84 int Foo::foos = 0;
86 void Foo::init_foo ()
88 foos = 80;
91 Foo::Foo ()
93 i = ++foos;
96 Foo::Foo (char*)
98 i = ++foos;
101 Foo::Foo (const Foo& foo)
103 i = ++foos;
104 for (int k = 0; k < FOO_MSG_LEN; k++)
105 message[k] = foo.message[k];
108 Foo& Foo::operator= (const Foo& foo)
110 for (int k = 0; k < FOO_MSG_LEN; k++)
111 message[k] = foo.message[k];
112 return *this;
115 Foo::~Foo ()
117 foos--;