Debian Codegraph @

gcc/testsuite/g++.dg/gcov/gcov-17.C

raw
1 /* { dg-options "--coverage -std=c++11" } */
2 /* { dg-do run { target native } } */
3
4 template <class T> class Foo
5 {
6 public:
7 Foo () : b (1000) {}
8
9 void inc () { b++; }
10
11 private:
12 int b;
13 };
14
15 template class Foo<int>;
16 template class Foo<char>;
17
18 static void noret()
19 {
20 __builtin_exit (0);
21 }
22
23 int
24 main (void)
25 {
26 int i, total;
27 Foo<int> counter;
28
29 counter.inc ();
30 counter.inc ();
31 total = 0;
32
33 for (i = 0; i < 10; i++)
34 total += i;
35
36 int v = total > 100 ? 1 : 2;
37
38 if (total != 45)
39 __builtin_printf ("Failure\n");
40 else
41 __builtin_printf ("Success\n");
42
43 noret ();
44 return 0;
45 }
46
47 /* { dg-final { run-gcov-pytest gcov-17.C "test-gcov-17.py" } } */