aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/gcov/pr16855-priority.C
blob: c7a58397bb911d54b37da015bee7b70ae5b9d626 (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
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
/* { dg-do run { target native } } */
/* { dg-require-effective-target init_priority } */

#include <stdlib.h>
#include <stdio.h>

int a;

void
foo ()
{
  fprintf (stderr, "In foo\n");
  a = 123; /* count(1) */
}

using namespace std;
class Test
{
public:
  Test (void) { fprintf (stderr, "In Test::Test\n"); /* count(1) */ }
  ~Test (void) {
   fprintf (stderr, "In Test::~Test\n"); /* count(1) { xfail *-*-dragonfly* } */
  }
} T1;

void
uncalled (void)
{
  fprintf (stderr, "In uncalled\n"); /* count(#####) */
}

int
main (void)
{
  atexit (&foo);
  fprintf (stderr, "In main\n"); /* count(1) */
  return 0;
}

static void __attribute__ ((constructor)) ctor_default ()
{
  fprintf (stderr, "in constructor(())\n"); /* count(1) */
}

static void __attribute__ ((constructor ((101)))) ctor_100 ()
{
  fprintf (stderr, "in constructor((101))\n"); /* count(1) */
}

static void __attribute__ ((constructor ((500)))) ctor_500 ()
{
  fprintf (stderr, "in constructor((500))\n"); /* count(1) */
}

static void __attribute__ ((constructor ((65535)))) ctor_65535 ()
{
  fprintf (stderr, "in constructor((65535))\n"); /* count(1) */
}

static void __attribute__ ((destructor)) dtor_default ()
{
  fprintf (stderr, "in destructor(())\n"); /* count(1) */
}

static void __attribute__ ((destructor ((101)))) dtor_100 ()
{
  fprintf (stderr, "in destructor((101))\n"); /* count(1) */
}

static void __attribute__ ((destructor ((500)))) dtor_500 ()
{
  fprintf (stderr, "in destructor((500))\n"); /* count(1) */
}

static void __attribute__ ((destructor ((65535)))) dtor_65535 ()
{
  fprintf (stderr, "in destructor((65535))\n"); /* count(1) */
}

/* { dg-final { run-gcov branches { -b pr16855-priority.C } { xfail *-*-dragonfly* } } } */