@@ -3017,6 +3017,7 @@ gimplify_switch_expr (tree *expr_p, gimple_seq *pre_p)
switch_stmt = gimple_build_switch (SWITCH_COND (switch_expr),
default_case, labels);
+ gimple_set_location (switch_stmt, EXPR_LOCATION (switch_expr));
/* For the benefit of -Wimplicit-fallthrough, if switch_body_seq
ends with a GIMPLE_LABEL holding SWITCH_BREAK_LABEL_P LABEL_DECL,
wrap the GIMPLE_SWITCH up to that GIMPLE_LABEL into a GIMPLE_BIND,
new file mode 100644
@@ -0,0 +1,30 @@
+/* { dg-options "-fprofile-arcs -ftest-coverage" } */
+/* { dg-do run { target native } } */
+
+int main()
+{
+ int a = 1;
+ int b = 2;
+ int c = -3;
+ switch(a) /* count(1) */
+ {
+ case 1: /* count(1) */
+ c = 3;
+ switch(b) { /* count(1) */
+ case 1: /* count(#####) */
+ c = 4;
+ break;
+ case 2: /* count(1) */
+ c = 5;
+ break;
+ }
+ break;
+ case 2: /* count(#####) */
+ c = 6;
+ break;
+ default: /* count(#####) */
+ break;
+ }
+}
+
+/* { dg-final { run-gcov gcov-24.c } } */