mirror of
https://github.com/TinyCC/tinycc.git
synced 2025-11-16 12:34:45 +00:00
implement test coverage
I have implemented the -ftest-coverage option. It works a bit different from the gcc version. It output .tcov text file which looks almost the same as a gcov file after a executable/so file is run. Add lib/tcov.c file Modify Makefiles to compile/install it Add -ftest-coverage option in tcc.c/tcc.h/tcc-doc.texi Add code to tccelf.c/tccgen.c/tccpe.c Add gen_increment_tcov to tcc.h/*gen.c unrelated changes: Add sigemptyset in tccrun.c Fix riscv64-gen.c tok_alloc label size
This commit is contained in:
13
i386-gen.c
13
i386-gen.c
@@ -1023,6 +1023,19 @@ ST_FUNC void gen_cvt_csti(int t)
|
||||
);
|
||||
}
|
||||
|
||||
/* increment tcov counter */
|
||||
ST_FUNC void gen_increment_tcov (SValue *sv)
|
||||
{
|
||||
o(0x0583); /* addl $1, xxx */
|
||||
greloc(cur_text_section, sv->sym, ind, R_386_32);
|
||||
gen_le32(0);
|
||||
o(1);
|
||||
o(0x1583); /* addcl $0, xxx */
|
||||
greloc(cur_text_section, sv->sym, ind, R_386_32);
|
||||
gen_le32(4);
|
||||
g(0);
|
||||
}
|
||||
|
||||
/* computed goto support */
|
||||
ST_FUNC void ggoto(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user