When performing coverage analysis, it is important that the line numbers
seen in the .c file are fairly accurate.
Currently we a lines to the end of a code block, and they appear to have
line numbers that correspond to whatever appears after the code block.
This is confusing.
So put all that extra code on the last line (matching the }$).
Also switch back to "gen_reduce" immediately after the code block.
Signed-off-by: NeilBrown <neil@brown.name>
## valgrind test code
@[ -n "$$SKIP_COVERAGE_CHECK" ] || awk '/NOTEST/ { next } /^ *[1-9]/ {ran+=1} /^ *###/ {skip+=1} \
END {printf "coverage: %6.2f%%\n", ran * 100 / (ran + skip); \
## valgrind test code
@[ -n "$$SKIP_COVERAGE_CHECK" ] || awk '/NOTEST/ { next } /^ *[1-9]/ {ran+=1} /^ *###/ {skip+=1} \
END {printf "coverage: %6.2f%%\n", ran * 100 / (ran + skip); \
- if (ran < (ran + skip) *0.968) exit(1) }' \
+ if (ran < (ran + skip) *0.973) exit(1) }' \
coverage/oceani.mdc.gcov
coverage_oceani: oceani.c
coverage/oceani.mdc.gcov
coverage_oceani: oceani.c
| ERROR ${ tok_err(c, "Syntax error in struct field", &$1); }$
Field -> IDENTIFIER : Type = Expression ${ {
| ERROR ${ tok_err(c, "Syntax error in struct field", &$1); }$
Field -> IDENTIFIER : Type = Expression ${ {
$0 = calloc(1, sizeof(struct fieldlist));
$0->f.name = $1.txt;
$0 = calloc(1, sizeof(struct fieldlist));
$0->f.name = $1.txt;
static void structure_print_type(struct type *t, FILE *f);
###### value functions
static void structure_print_type(struct type *t, FILE *f);
###### value functions
- static void structure_print_type(struct type *t, FILE *f) // UNTESTED
- { // UNTESTED
- int i; // UNTESTED
+ static void structure_print_type(struct type *t, FILE *f)
+ {
+ int i;
fprintf(f, "struct %.*s\n", t->name.len, t->name.txt);
fprintf(f, "struct %.*s\n", t->name.len, t->name.txt);
}
###### print type decls
}
###### print type decls
- { // UNTESTED
- struct type *t; // UNTESTED
int target = -1;
while (target != 0) {
int target = -1;
while (target != 0) {
for (i = 0; i < p->body_size; i++) {
if (p->body[i]->struct_name.txt &&
used[i]) {
// assume this has been copied out
if (p->body[i]->isref)
for (i = 0; i < p->body_size; i++) {
if (p->body[i]->struct_name.txt &&
used[i]) {
// assume this has been copied out
if (p->body[i]->isref)
- fprintf(f, "\t\t*(void**)body[%d] = NULL;\n", i);
+ fprintf(f, "\t\t*(void**)body[%d] = NULL;", i);
- fprintf(f, "\t\tmemset(body[%d], 0, sizeof(struct %.*s));\n", i, p->body[i]->struct_name.len, p->body[i]->struct_name.txt);
+ fprintf(f, "\t\tmemset(body[%d], 0, sizeof(struct %.*s));", i, p->body[i]->struct_name.len, p->body[i]->struct_name.txt);
if (p->code.txt) {
fprintf(f, "#line %d \"%s\"\n", p->code_line, file);
gen_code(p, f, g);
if (p->code.txt) {
fprintf(f, "#line %d \"%s\"\n", p->code_line, file);
gen_code(p, f, g);
+ fprintf(f, "#line 7 \"gen_reduce\"\n");
}
if (p->head->struct_name.txt)
}
if (p->head->struct_name.txt)