aboutsummaryrefslogtreecommitdiff
path: root/tinycc/tests/tests2/108_constructor.c
blob: 145d0da6939e35401e5bfcd6632123c65e0faea9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
extern int write (int fd, void *buf, int len);

static void __attribute__ ((constructor))
testc (void)
{
  write (1, "constructor\n", 12);
}

static void __attribute__ ((destructor))
testd (void)
{
  write (1, "destructor\n", 11);
}

int
main (void)
{
  write (1, "main\n", 5);
  return 0;
}