]>
Commit | Line | Data |
---|---|---|
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 | ||
8 | int a; | |
9 | ||
10 | void | |
11 | foo () | |
12 | { | |
13 | fprintf (stderr, "In foo\n"); | |
14 | a = 123; /* count(1) */ | |
15 | } | |
16 | ||
17 | using namespace std; | |
18 | class Test | |
19 | { | |
20 | public: | |
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 | ||
27 | void | |
28 | uncalled (void) | |
29 | { | |
30 | fprintf (stderr, "In uncalled\n"); /* count(#####) */ | |
31 | } | |
32 | ||
33 | int | |
34 | main (void) | |
35 | { | |
36 | atexit (&foo); | |
37 | fprintf (stderr, "In main\n"); /* count(1) */ | |
38 | return 0; | |
39 | } | |
40 | ||
41 | static void __attribute__ ((constructor)) ctor_default () | |
42 | { | |
43 | fprintf (stderr, "in constructor(())\n"); /* count(1) */ | |
44 | } | |
45 | ||
46 | static void __attribute__ ((constructor ((101)))) ctor_100 () | |
47 | { | |
48 | fprintf (stderr, "in constructor((101))\n"); /* count(1) */ | |
49 | } | |
50 | ||
51 | static void __attribute__ ((constructor ((500)))) ctor_500 () | |
52 | { | |
53 | fprintf (stderr, "in constructor((500))\n"); /* count(1) */ | |
54 | } | |
55 | ||
56 | static void __attribute__ ((constructor ((65535)))) ctor_65535 () | |
57 | { | |
58 | fprintf (stderr, "in constructor((65535))\n"); /* count(1) */ | |
59 | } | |
60 | ||
61 | static void __attribute__ ((destructor)) dtor_default () | |
62 | { | |
63 | fprintf (stderr, "in destructor(())\n"); /* count(1) */ | |
64 | } | |
65 | ||
66 | static void __attribute__ ((destructor ((101)))) dtor_100 () | |
67 | { | |
68 | fprintf (stderr, "in destructor((101))\n"); /* count(1) */ | |
69 | } | |
70 | ||
71 | static void __attribute__ ((destructor ((500)))) dtor_500 () | |
72 | { | |
73 | fprintf (stderr, "in destructor((500))\n"); /* count(1) */ | |
74 | } | |
75 | ||
76 | static 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* } } } */ |