aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-srec/sr3.cc
blob: 0b5fa7ec89355b92e9cbfb64447164f3376d2780 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
// This file is compiled and linked into the S-record format.

#define FOO_MSG_LEN 80

class Foo {
    static int foos;
    int i;
    static const int len = FOO_MSG_LEN;
    char message[len];
public:
    static void init_foo ();
    static int nb_foos() { return foos; }
    Foo();
    Foo(const char* message);
    Foo(const Foo&);
    Foo & operator= (const Foo&);
    ~Foo ();
};

static Foo static_foo( "static_foo");

int
main ()
{
  Foo automatic_foo( "automatic_foo");
  return 0;
}

void
terminate(void)
{
  /* This recursive call prevents a compiler warning that the noreturn
     function terminate actually does return.  */
  terminate ();
}

extern "C" {
void
__main ()
{
}

void
__builtin_delete ()
{
}

void
__builtin_new ()
{
}

void
__throw ()
{
}

void
__rethrow ()
{
}

void
__terminate ()
{
}

void *__eh_pc;

void ***
__get_dynamic_handler_chain ()
{
  return 0;
}

void *
__get_eh_context ()
{
  return 0;
}

}

int Foo::foos = 0;

void Foo::init_foo ()
{
  foos = 80;
}

Foo::Foo ()
{
  i = ++foos;
}

Foo::Foo (const char*)
{
  i = ++foos;
}

Foo::Foo (const Foo& foo)
{
  i = ++foos;
  for (int k = 0; k < FOO_MSG_LEN; k++)
    message[k] = foo.message[k];
}

Foo& Foo::operator= (const Foo& foo)
{
  for (int k = 0; k < FOO_MSG_LEN; k++)
    message[k] = foo.message[k];
  return *this;
}

Foo::~Foo ()
{
  foos--;
}

void *__dso_handle;

extern "C"
int
__cxa_atexit (void)
{
  return 0;
}