source: trunk/binutils/ld/testsuite/ld-srec/sr3.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: 1.4 KB
Line 
1// This file is compiled and linked into the S-record format.
2
3#define FOO_MSG_LEN 80
4
5class Foo {
6 static int foos;
7 int i;
8 static const int len = FOO_MSG_LEN;
9 char message[len];
10public:
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 ();
18};
19
20static Foo static_foo( "static_foo");
21
22int
23main ()
24{
25 Foo automatic_foo( "automatic_foo");
26 return 0;
27}
28
29void
30terminate(void)
31{
32 /* This recursive call prevents a compiler warning that the noreturn
33 function terminate actually does return. */
34 terminate ();
35}
36
37extern "C" {
38void
39__main ()
40{
41}
42
43void
44__builtin_delete ()
45{
46}
47
48void
49__builtin_new ()
50{
51}
52
53void
54__throw ()
55{
56}
57
58void
59__rethrow ()
60{
61}
62
63void
64__terminate ()
65{
66}
67
68void *__eh_pc;
69
70void ***
71__get_dynamic_handler_chain ()
72{
73 return 0;
74}
75
76void *
77__get_eh_context ()
78{
79 return 0;
80}
81
82}
83
84int Foo::foos = 0;
85
86void Foo::init_foo ()
87{
88 foos = 80;
89}
90
91Foo::Foo ()
92{
93 i = ++foos;
94}
95
96Foo::Foo (char*)
97{
98 i = ++foos;
99}
100
101Foo::Foo (const Foo& foo)
102{
103 i = ++foos;
104 for (int k = 0; k < FOO_MSG_LEN; k++)
105 message[k] = foo.message[k];
106}
107
108Foo& Foo::operator= (const Foo& foo)
109{
110 for (int k = 0; k < FOO_MSG_LEN; k++)
111 message[k] = foo.message[k];
112 return *this;
113}
114
115Foo::~Foo ()
116{
117 foos--;
118}
119
120void *__dso_handle;
121
122extern "C"
123int
124__cxa_atexit (void)
125{
126 return 0;
127}
Note: See TracBrowser for help on using the repository browser.