]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/g++.dg/gcov/pr16855-priority.C
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / gcov / pr16855-priority.C
CommitLineData
78681a7b
ML
1/* { dg-options "-fprofile-arcs -ftest-coverage" } */
2/* { dg-do run { target native } } */
3/* { dg-require-effective-target init_priority } */
4
5#include <stdlib.h>
6#include <stdio.h>
7
8int a;
9
10void
11foo ()
12{
13 fprintf (stderr, "In foo\n");
14 a = 123; /* count(1) */
15}
16
17using namespace std;
18class Test
19{
20public:
21 Test (void) { fprintf (stderr, "In Test::Test\n"); /* count(1) */ }
32657045
RJ
22 ~Test (void) {
23 fprintf (stderr, "In Test::~Test\n"); /* count(1) { xfail *-*-dragonfly* } */
24 }
78681a7b
ML
25} T1;
26
27void
28uncalled (void)
29{
30 fprintf (stderr, "In uncalled\n"); /* count(#####) */
31}
32
33int
34main (void)
35{
36 atexit (&foo);
37 fprintf (stderr, "In main\n"); /* count(1) */
38 return 0;
39}
40
41static void __attribute__ ((constructor)) ctor_default ()
42{
43 fprintf (stderr, "in constructor(())\n"); /* count(1) */
44}
45
46static void __attribute__ ((constructor ((101)))) ctor_100 ()
47{
48 fprintf (stderr, "in constructor((101))\n"); /* count(1) */
49}
50
51static void __attribute__ ((constructor ((500)))) ctor_500 ()
52{
53 fprintf (stderr, "in constructor((500))\n"); /* count(1) */
54}
55
56static void __attribute__ ((constructor ((65535)))) ctor_65535 ()
57{
58 fprintf (stderr, "in constructor((65535))\n"); /* count(1) */
59}
60
61static void __attribute__ ((destructor)) dtor_default ()
62{
63 fprintf (stderr, "in destructor(())\n"); /* count(1) */
64}
65
66static void __attribute__ ((destructor ((101)))) dtor_100 ()
67{
68 fprintf (stderr, "in destructor((101))\n"); /* count(1) */
69}
70
71static void __attribute__ ((destructor ((500)))) dtor_500 ()
72{
73 fprintf (stderr, "in destructor((500))\n"); /* count(1) */
74}
75
76static void __attribute__ ((destructor ((65535)))) dtor_65535 ()
77{
78 fprintf (stderr, "in destructor((65535))\n"); /* count(1) */
79}
80
32657045 81/* { dg-final { run-gcov branches { -b pr16855-priority.C } { xfail *-*-dragonfly* } } } */