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 30835-e55edf4b45) Lines: 605 680 89.0 %
Date: 2026-04-24 09:27:20 Functions: 214 238 89.9 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Mod64 0
affectsign 0
divsi_rem 0
divss 0
divss_rem 0
dvdiiz 0
dvdisz 0
dvdiuz 0
dvmdis 0
dvmdsi 0
dvmdss 0
get_avma 0
mod64 0
modss 0
mpceil 0
mpfloor 0
rdivis 0
rdivsi 0
remis 0
remsi 0
remss 0
sdivss_rem 0
shiftl 0
shiftlr 0
mptrunc 49
real_m2n 126
varnmax 203
mod32 259
dvdsi 371
real_m1 455
mpcopy 665
ugcdui 2737
thuemorseu 3313
stack_calloc_align 3325
varnmin 10374
uabsdivui_rem 16693
absr 20510
addss 25067
subss 25067
subuu 25067
dvdis 33737
cmprs 40996
cgetr_block 44265
sdivsi 102148
stack_calloc 110698
gc_stoi 155902
dvdui 167195
subis 171737
Fl_ellj_pre 238054
mindd 264380
truedivis 268378
cmpri 302870
mod16 307028
Mod32 311108
uutoineg 362653
Mod16 389733
mpdiv 395375
cgetg_block 424561
gc_utoi 468716
dvdiu 576273
umodui 711392
cmpsr 796118
rdivss 839647
real2n 1068647
addri 1106188
equalis 1151205
equalsi 1151388
gc_utoipos 1153582
real_0 1157755
mpround 1216581
absrnz_equal2n 1301127
cmpss 1392943
Mod8 2073844
mpcmp 2156195
Mod2 2370214
udivuu_rem 2418379
gc_int 2739301
mulru 2765892
subir 3000057
equaliu 3021830
equalui 3021831
itou_or_0 3147016
maxdd 3211531
cmpis 3634539
negr 3683095
cmpsi 3866538
ceildivuu 3905011
Fl_center 4486181
absrnz_equal1 4556838
real_1_bit 4714232
mod4 5140970
subri 6067643
subsi 6184712
truedivsi 6202318
umuluu_or_0 6317081
affsi 6446432
maxuu 6611028
mulrs 7181596
fractor 7380417
umuluu_le 7617880
gc_NULL 7961514
cmpir 9461451
ugcdiu 10320897
affectsign_safe 10729720
uabsdiviu_rem 11892741
addrs 12363972
smodss 12467050
cmpiu 12982665
cmpui 12982992
rdivii 13105455
rdiviiz 13151378
mpabs_shallow 13428463
divii 14046687
utor 14266491
affur 14266592
mod8 15585970
subrs 16544189
dvdii 16904802
Fl_halve 18769917
modis 19638526
int_bit 20963544
smodis 21176088
hammingu 24048710
evalvalser 24359582
abscmpui 32682232
abscmpiu 32682341
mulri 38307211
mpexpo 38876082
absequaliu 39546379
absequalui 41296399
Mod4 43850422
itos_or_0 44911853
modsi 45242185
affui 45491533
Fl_div 46744905
stack_malloc 46923521
umodi2n 48993642
sdivsi_rem 51446799
gc_ulong 51702461
truedivii 54720661
stack_malloc_align 55535812
affrr_fixlg 56115276
absi_shallow 56724278
gc_bool 56794066
mod2 62589871
Fl_addmulmul_pre 64559516
minuu 69583707
remlll_pre 75677653
evalprecp 78672644
evalvalp 81629333
Fl_triple 87266205
mpsqr 90787796
addiu 97426284
Fl_sqr 99500695
addui 101501409
fixlg 105854943
mod2BIL 107447339
mpodd 116093887
icopyspec 118026321
subiu 133459194
real_1 133692224
subui 138436367
mpshift 153471154
togglesign_safe 157262607
dvmduBIL 165628297
itou 179080642
gc_double 184134070
shiftr 188188106
vali 191177408
addis 194778687
varncmp 199456789
gc_long 242673681
mpsub 249772615
utoineg 298139122
cgetineg 298999803
rtor 303780601
addsi 319965200
muliu 373324187
Fl_double 442238443
shiftr_inplace 466871126
mulis 467105858
itos 476303069
addir 482804120
real_0_bit 484273153
affsr 501400571
stor 501714361
mpadd 574509424
negi 641058955
itor 716836359
Fl_neg 728899227
umodsu 734178639
expu 797091670
stoi 798958150
lg2prec 815903183
mpmul 837331373
rcopy 916880545
mpneg 926938511
affii 965051884
subrr 1006557249
cmpuu 1490536872
cgetg_copy 1492158381
cgetr 1875934458
togglesign 1953799441
minss 2027732477
absi 2068980193
mpabs 2139951592
setabssign 2207269105
Fl_sqr_pre 2334902674
nbits2lg 2404817750
expi 2425294867
Fl_mul 2436130607
addrr 2933301028
remii 3062083490
adduu 3448883669
stackdummy 3685541006
Fl_mul_pre 4214257618
leafcopy 5064383473
shift_right 5732887343
Fl_add 6134668182
dvmdsBIL 7150473004
Fl_sub 7394104376
Fl_addmul_pre 7654815807
subii 7719077380
shift_left 7798143057
uutoi 8937215525
icopy 9155389201
maxss 9703254188
utoi 12052941409
addii 12533053069
evalexpo 13397173252
utoipos 14268554038
gc_const 15654059458
cgetipos 16450595256
cgetg 25525929460
cgeti 27477010563
new_chunk 95138269374
evallg 96863427189
set_avma 131354271042

Generated by: LCOV version 1.16