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 30674-be81ecfdd4) Lines: 605 680 89.0 %
Date: 2026-02-13 09:23:38 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
absr 140
varnmax 203
mod32 259
dvdsi 371
real_m1 455
mpcopy 665
ugcdui 2737
thuemorseu 2851
stack_calloc_align 3307
varnmin 14728
uabsdivui_rem 16693
addss 25067
subss 25067
subuu 25067
dvdis 33709
cmprs 40996
cgetr_block 43835
sdivsi 102147
stack_calloc 110379
gc_stoi 155887
dvdui 167195
subis 170917
Fl_ellj_pre 238064
mod16 241109
mindd 264337
truedivis 266947
cmpri 282310
Mod32 311108
uutoineg 364197
Mod16 389733
cgetg_block 424931
gc_utoi 468599
dvdiu 576268
mpdiv 665647
cmpsr 796106
rdivss 839647
real2n 1067059
addri 1106217
gc_utoipos 1153487
real_0 1156510
equalis 1185516
equalsi 1185699
mpround 1216599
absrnz_equal2n 1292593
umodui 1296276
cmpss 1392943
Mod8 2074121
mpcmp 2226380
Mod2 2370240
udivuu_rem 2418330
gc_int 2631187
mulru 2765892
subir 3005093
equaliu 3018233
equalui 3018233
itou_or_0 3041731
maxdd 3178285
cmpis 3634916
negr 3671484
cmpsi 3866915
ceildivuu 3903905
Fl_center 4486194
absrnz_equal1 4519853
real_1_bit 4704923
maxuu 4815089
mod4 5084874
umuluu_or_0 5529732
umuluu_le 5803291
subsi 6094115
subri 6136599
truedivsi 6202031
affsi 6373259
mulrs 7181596
fractor 7376921
gc_NULL 7962716
cmpir 9431789
ugcdiu 10114284
cmpiu 10133586
cmpui 10133621
affectsign_safe 10726928
uabsdiviu_rem 11892741
addrs 12304815
smodss 12671491
rdivii 13105523
rdiviiz 13148803
mod8 13163619
mpabs_shallow 13428463
utor 13462033
affur 13462148
divii 14055308
subrs 16475693
dvdii 16569704
Fl_halve 18805639
modis 19638526
int_bit 20975362
smodis 21176060
evalvalser 21528999
hammingu 24048420
abscmpiu 32705879
abscmpui 32705984
mulri 38033704
mpexpo 38875326
absequaliu 39398240
absequalui 41147155
itos_or_0 43600478
Mod4 43798825
modsi 45225511
affui 45473822
Fl_div 46547285
stack_malloc 46625334
truedivii 47050531
umodi2n 48942507
sdivsi_rem 51429860
gc_bool 51994821
gc_ulong 52062967
affrr_fixlg 54653850
stack_malloc_align 55498545
absi_shallow 57751351
mod2 61112871
Fl_addmulmul_pre 64658702
minuu 69312949
remlll_pre 76065660
evalprecp 78671947
evalvalp 81629469
mpsqr 91027926
Fl_triple 94873657
Fl_sqr 95911520
addiu 96092276
addui 99736531
mod2BIL 103308305
fixlg 104196761
mpodd 115075830
icopyspec 117434188
togglesign_safe 125549790
real_1 129820914
subiu 131852817
subui 136826058
mpshift 153279004
dvmduBIL 166064161
shiftr 177982737
itou 178274925
addis 181580495
gc_double 184160688
vali 190382901
varncmp 217197812
gc_long 242459977
mpsub 251586795
utoineg 293986727
cgetineg 294848395
rtor 295253851
addsi 306766116
muliu 374613307
itos 462188440
shiftr_inplace 464468906
mulis 466294909
Fl_double 470845396
real_0_bit 479231447
addir 481445800
affsr 486140988
stor 486450537
mpadd 574380743
negi 636827212
itor 715078519
Fl_neg 724248645
umodsu 734162514
stoi 772808890
expu 775428484
lg2prec 800003610
mpmul 837675998
rcopy 903320184
affii 910718357
mpneg 916785428
subrr 1000315869
cgetg_copy 1480354970
cmpuu 1492947816
cgetr 1840669278
togglesign 1912719007
minss 2010717121
absi 2067555727
mpabs 2138343253
Fl_sqr_pre 2180662505
setabssign 2205052336
nbits2lg 2366664327
Fl_mul 2422100292
expi 2448757526
addrr 2878621991
remii 3008731297
adduu 3411003765
stackdummy 3642228010
Fl_mul_pre 4107360333
Fl_add 4415755534
leafcopy 4975960807
shift_right 5635712249
dvmdsBIL 7014810870
Fl_sub 7275561030
subii 7641867783
shift_left 7679192912
Fl_addmul_pre 7692186220
uutoi 8816038298
icopy 9054690443
maxss 9705330476
utoi 11903924253
addii 12411348777
evalexpo 13142650213
utoipos 14152006859
gc_const 15513996647
cgetipos 16321805824
cgetg 24564475371
cgeti 27096551301
new_chunk 93260654262
evallg 95226872676
set_avma 129032063526

Generated by: LCOV version 1.16