PR c++/81917 - ICE with void_t and partial specialization.
[official-gcc.git] / gcc / testsuite / gcc.misc-tests / gcov-17.c
blobe38860808445381275c13d959e8521932884f26f
1 /* Test gcov block mode. Compiler generates following CFG:
3 <bb 3>:
4 if (false_var_4 != 0)
5 goto <bb 4>;
6 else
7 goto <bb 5>;
9 <bb 4>:
10 ret_6 = 111;
11 PROF_edge_counter_10 = __gcov0.UuT[0];
12 PROF_edge_counter_11 = PROF_edge_counter_10 + 1;
13 __gcov0.UuT[0] = PROF_edge_counter_11;
15 <bb 5>:
16 # ret_1 = PHI <ret_5(3), ret_6(4)>
17 goto <bb 7>;
19 It's important not to include <bb 5> to any line as it's actually shared
20 by both branches of the condition in <bb 3>.
24 /* { dg-options "-fprofile-arcs -ftest-coverage" } */
25 /* { dg-do run { target native } } */
27 unsigned int
28 UuT (void)
30 unsigned int true_var = 1;
31 unsigned int false_var = 0;
32 unsigned int ret = 0;
34 if (true_var) /* count(1) */
36 if (false_var) /* count(1) */
37 ret = 111; /* count(#####) */
39 else
40 ret = 999; /* count(#####) */
41 return ret;
44 int
45 main (int argc, char **argv)
47 UuT ();
48 return 0;
51 /* { dg-final { run-gcov { -a gcov-17.c } } } */