+ }
+
+ if (flag_branches)
+ fn = src->functions;
+
+ for (line_num = 1, line = &src->lines[line_num];
+ line_num < src->num_lines; line_num++, line++)
+ {
+ for (; fn && fn->line == line_num; fn = fn->line_next)
+ {
+ arc_t *arc = fn->blocks[fn->num_blocks - 1].pred;
+ gcov_type return_count = fn->blocks[fn->num_blocks - 1].count;
+
+ for (; arc; arc = arc->pred_next)
+ if (arc->fake)
+ return_count -= arc->count;
+
+ fprintf (gcov_file, "function %s", fn->name);
+ fprintf (gcov_file, " called %s",
+ format_gcov (fn->blocks[0].count, 0, -1));
+ fprintf (gcov_file, " returned %s",
+ format_gcov (return_count, fn->blocks[0].count, 0));
+ fprintf (gcov_file, " blocks executed %s",
+ format_gcov (fn->blocks_executed, fn->num_blocks - 2, 0));
+ fprintf (gcov_file, "\n");
+ }
+
+ /* For lines which don't exist in the .bb file, print '-' before
+ the source line. For lines which exist but were never
+ executed, print '#####' before the source line. Otherwise,
+ print the execution count before the source line. There are
+ 16 spaces of indentation added before the source line so that
+ tabs won't be messed up. */
+ fprintf (gcov_file, "%9s:%5u:",
+ !line->exists ? "-" : !line->count ? "#####"
+ : format_gcov (line->count, 0, -1), line_num);
+
+ if (retval)
+ {
+ /* Copy source line. */
+ do
+ {
+ retval = fgets (string, STRING_SIZE, source_file);
+ if (!retval)
+ break;
+ fputs (retval, gcov_file);
+ }
+ while (!retval[0] || retval[strlen (retval) - 1] != '\n');
+ }
+ if (!retval)
+ fputs ("/*EOF*/\n", gcov_file);
+
+ if (flag_all_blocks)
+ {
+ block_t *block;
+ arc_t *arc;
+ int ix, jx;
+
+ for (ix = jx = 0, block = line->u.blocks; block;
+ block = block->chain)
+ {
+ if (!block->is_call_return)
+ fprintf (gcov_file, "%9s:%5u-block %2d\n",
+ !line->exists ? "-" : !block->count ? "$$$$$"
+ : format_gcov (block->count, 0, -1),
+ line_num, ix++);
+ if (flag_branches)
+ for (arc = block->succ; arc; arc = arc->succ_next)
+ jx += output_branch_count (gcov_file, jx, arc);
+ }
+ }
+ else if (flag_branches)
+ {
+ int ix;
+ arc_t *arc;