Debian Codegraph @

gcc/testsuite/g++.dg/gcov/pr16855.C

raw
1 /* { dg-options "-fprofile-arcs -ftest-coverage" } */
2 /* { dg-do run { target native } } */
3
4 /* See PR91087 for information on Darwin xfails. */
5
6 #include <stdlib.h>
7 #include <stdio.h>
8
9 int a;
10
11 void
12 foo ()
13 {
14 fprintf (stderr, "In foo\n");
15 a = 123; /* count(1) */
16 }
17
18 using namespace std;
19 class Test
20 {
21 public:
22 Test (void) { fprintf (stderr, "In Test::Test\n"); /* count(1) */ }
23 ~Test (void) {
24 fprintf (stderr, "In Test::~Test\n"); /* count(1) { xfail *-*-darwin* *-*-dragonfly* } */
25 }
26 } T1;
27
28 void
29 uncalled (void)
30 {
31 fprintf (stderr, "In uncalled\n"); /* count(#####) */
32 }
33
34 int
35 main (void)
36 {
37 atexit (&foo);
38 fprintf (stderr, "In main\n"); /* count(1) */
39 return 0;
40 }
41
42 static void __attribute__ ((constructor)) ctor_default ()
43 {
44 fprintf (stderr, "in constructor(())\n"); /* count(1) */
45 }
46
47 static void __attribute__ ((destructor)) dtor_default ()
48 {
49 fprintf (stderr, "in destructor(())\n"); /* count(1) { xfail *-*-darwin* } */
50 }
51
52 /* { dg-final { run-gcov branches { -b pr16855.C } { xfail *-*-darwin* *-*-dragonfly* } } } */