Code coverage tests

This page documents the degree to which the PARI/GP source code is tested by our public test suite, distributed with the source distribution in directory src/test/. This is measured by the gcov utility; we then process gcov output using the lcov frond-end.

We test a few variants depending on Configure flags on the pari.math.u-bordeaux.fr machine (x86_64 architecture), and agregate them in the final report:

The target is to exceed 90% coverage for all mathematical modules (given that branches depending on DEBUGLEVEL or DEBUGMEM are not covered). This script is run to produce the results below.

LCOV - code coverage report
Current view: top level - kernel/none - level1.h (source / functions) Hit Total Coverage
Test: PARI/GP v2.18.1 lcov report (development 30617-dd5c93fb0e) Lines: 605 680 89.0 %
Date: 2026-01-20 09:21:06 Functions: 214 238 89.9 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Fl_add 4360109103
Fl_addmul_pre 7641104257
Fl_addmulmul_pre 64479810
Fl_center 4486048
Fl_div 46447625
Fl_double 466099333
Fl_ellj_pre 238036
Fl_halve 18753483
Fl_mul 2417503597
Fl_mul_pre 4067512572
Fl_neg 719107891
Fl_sqr 95827126
Fl_sqr_pre 2165068735
Fl_sub 7236000496
Fl_triple 93855962
Mod16 389733
Mod2 2370262
Mod32 311108
Mod4 43766197
Mod64 0
Mod8 2073917
abscmpiu 32071997
abscmpui 32072042
absequaliu 39660819
absequalui 41409743
absi 2068266537
absi_shallow 57123737
absr 140
absrnz_equal1 4519876
absrnz_equal2n 1292608
addii 12397912181
addir 481351561
addis 181561822
addiu 94817092
addri 1105768
addrr 2877510167
addrs 12305200
addsi 306744802
addss 25067
addui 98461047
adduu 3407500693
affectsign 0
affectsign_safe 10727614
affii 910031842
affrr_fixlg 54651746
affsi 6373059
affsr 486006708
affui 45473825
affur 13461482
ceildivuu 3903463
cgetg 24520196004
cgetg_block 407200
cgetg_copy 1480053168
cgeti 27076550389
cgetineg 294807657
cgetipos 16293489495
cgetr 1839827535
cgetr_block 43583
cmpir 9447050
cmpis 3634893
cmpiu 10132432
cmpri 282310
cmprs 40996
cmpsi 3866894
cmpsr 796101
cmpss 1379853
cmpui 10132294
cmpuu 1492598350
divii 14035862
divsi_rem 0
divss 0
divss_rem 0
dvdii 16566863
dvdiiz 0
dvdis 33709
dvdisz 0
dvdiu 576262
dvdiuz 0
dvdsi 371
dvdui 167195
dvmdis 0
dvmdsBIL 7006259870
dvmdsi 0
dvmdss 0
dvmduBIL 165614973
equalis 1185624
equaliu 3018191
equalsi 1185806
equalui 3018192
evalexpo 13129690459
evallg 95127274913
evalprecp 78659704
evalvalp 81616360
evalvalser 21527935
expi 2448055294
expu 775220745
fixlg 104194583
fractor 7376752
gc_NULL 7961405
gc_bool 51987977
gc_const 15506472717
gc_double 184094384
gc_int 2631174
gc_long 242310954
gc_stoi 155880
gc_ulong 52047878
gc_utoi 468647
gc_utoipos 1153465
get_avma 0
hammingu 24048478
icopy 9050848310
icopyspec 117423961
int_bit 20940770
itor 714580631
itos 462128951
itos_or_0 43598087
itou 178232840
itou_or_0 3041717
leafcopy 4973214282
lg2prec 799541823
maxdd 3178605
maxss 9678312788
maxuu 4814915
mindd 264340
minss 2008845557
minuu 69260966
mod16 241108
mod2 61112884
mod2BIL 103303636
mod32 259
mod4 5084158
mod64 0
mod8 13163670
modis 19638526
modsi 45225532
modss 0
mpabs 2139061439
mpabs_shallow 13428463
mpadd 575971110
mpceil 0
mpcmp 2225910
mpcopy 665
mpdiv 665647
mpexpo 38872061
mpfloor 0
mpmul 839082001
mpneg 916697612
mpodd 115076291
mpround 1216575
mpshift 153146206
mpsqr 91024344
mpsub 251523103
mptrunc 49
mulis 466265195
muliu 374379212
mulri 38033693
mulrs 7181596
mulru 2765892
nbits2lg 2367498278
negi 636788887
negr 3670767
new_chunk 93174888206
rcopy 903031939
rdivii 13099681
rdiviiz 13145666
rdivis 0
rdivsi 0
rdivss 839647
real2n 1067006
real_0 1156404
real_0_bit 480994348
real_1 129788725
real_1_bit 4704767
real_m1 455
real_m2n 126
remii 3004064644
remis 0
remlll_pre 75563934
remsi 0
remss 0
rtor 295230723
sdivsi 102145
sdivsi_rem 51429859
sdivss_rem 0
set_avma 128890280408
setabssign 2205761234
shift_left 7675492860
shift_right 5626736861
shiftl 0
shiftlr 0
shiftr 177960652
shiftr_inplace 463994903
smodis 21176060
smodss 12460994
stack_calloc 110351
stack_calloc_align 3307
stack_malloc 46626984
stack_malloc_align 55496535
stackdummy 3635517005
stoi 772792216
stor 486331035
subii 7654630690
subir 3005086
subis 170914
subiu 131841430
subri 6096865
subrr 1000051378
subrs 16475576
subsi 6093478
subss 25067
subui 136814351
subuu 25067
thuemorseu 2851
togglesign 1911760849
togglesign_safe 125524291
truedivii 47022012
truedivis 266949
truedivsi 6202031
uabsdiviu_rem 11892741
uabsdivui_rem 16693
udivuu_rem 2416412
ugcdiu 10113582
ugcdui 2737
umodi2n 48909918
umodsu 723942396
umodui 1296276
umuluu_le 5803291
umuluu_or_0 5538758
utoi 11888133662
utoineg 293946373
utoipos 14131419271
utor 13461365
uutoi 8799033215
uutoineg 361995
vali 190376335
varncmp 217203100
varnmax 203
varnmin 15547

Generated by: LCOV version 1.16