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 30711-c92306d4b4) Lines: 605 680 89.0 %
Date: 2026-02-25 09:24:21 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 33723
cmprs 40996
cgetr_block 43771
sdivsi 102147
stack_calloc 110476
gc_stoi 155887
dvdui 167195
subis 171739
Fl_ellj_pre 238049
mindd 264339
truedivis 266959
cmpri 282310
mod16 307019
Mod32 311108
uutoineg 363554
Mod16 389733
cgetg_block 425033
gc_utoi 468670
dvdiu 576265
mpdiv 665644
cmpsr 796105
rdivss 839647
real2n 1067051
addri 1106289
equalis 1151186
equalsi 1151368
gc_utoipos 1153474
real_0 1156528
mpround 1216569
umodui 1290981
absrnz_equal2n 1292578
cmpss 1392943
Mod8 2074322
mpcmp 2226380
Mod2 2370298
udivuu_rem 2418330
gc_int 2631178
mulru 2765892
subir 3005106
equaliu 3018285
equalui 3018286
itou_or_0 3146852
maxdd 3178533
cmpis 3633431
negr 3671749
cmpsi 3865432
ceildivuu 3903362
Fl_center 4486195
absrnz_equal1 4519960
real_1_bit 4704912
maxuu 4815411
mod4 5139806
umuluu_le 5803291
umuluu_or_0 6125347
subri 6140644
subsi 6182683
truedivsi 6202031
affsi 6437457
mulrs 7181596
fractor 7376928
gc_NULL 7961601
cmpir 9433694
ugcdiu 10145833
affectsign_safe 10727947
uabsdiviu_rem 11892741
cmpiu 12181996
cmpui 12182052
addrs 12305097
smodss 12653906
rdivii 13103783
rdiviiz 13146287
mpabs_shallow 13428463
utor 13461919
affur 13462039
divii 14063855
mod8 15578937
subrs 16475975
dvdii 16905469
Fl_halve 18821583
modis 19638526
int_bit 20984565
smodis 21176074
evalvalser 21529076
hammingu 24048389
abscmpiu 32584028
abscmpui 32584088
mulri 38033959
mpexpo 38875748
absequaliu 39398968
absequalui 41147876
itos_or_0 43600430
Mod4 43853168
modsi 45225720
affui 45473824
Fl_div 46504404
stack_malloc 46823265
umodi2n 48997732
sdivsi_rem 51430048
gc_ulong 52047786
gc_bool 54082076
affrr_fixlg 54654638
truedivii 54729986
stack_malloc_align 55500978
absi_shallow 58118627
mod2 61231063
Fl_addmulmul_pre 64763809
minuu 69688789
remlll_pre 76122022
evalprecp 78672632
evalvalp 81628987
mpsqr 91031109
Fl_triple 91234551
addiu 97123019
Fl_sqr 99454695
addui 100770903
fixlg 104200374
mod2BIL 106064913
mpodd 115175790
icopyspec 117471168
real_1 129876469
subiu 131921870
subui 136894907
mpshift 153255749
togglesign_safe 157205447
dvmduBIL 158069146
shiftr 178070289
itou 178233334
gc_double 184161666
addis 184527679
vali 190460680
varncmp 217195179
gc_long 242516499
mpsub 251603197
rtor 295254069
utoineg 297159521
cgetineg 298019842
addsi 309712117
muliu 375715550
Fl_double 453073950
shiftr_inplace 464403099
mulis 467019080
itos 472277656
real_0_bit 479471602
addir 481447767
affsr 486280816
stor 486559074
mpadd 574629955
negi 638070123
itor 715179790
Fl_neg 723544436
umodsu 734164728
expu 775643351
stoi 797060612
lg2prec 800141324
mpmul 837919090
rcopy 903484545
mpneg 918019947
affii 957841786
subrr 1000275563
cgetg_copy 1480487915
cmpuu 1493851718
cgetr 1840958246
togglesign 1941451787
minss 2010874855
absi 2068366292
mpabs 2139159407
Fl_sqr_pre 2154896801
setabssign 2205895107
nbits2lg 2367135663
expi 2422030116
Fl_mul 2428102975
addrr 2878024248
remii 3020059551
adduu 3445927954
stackdummy 3631780780
Fl_mul_pre 4084572005
Fl_add 4390413312
leafcopy 4976592836
shift_right 5632828029
dvmdsBIL 7032156063
Fl_sub 7222676761
Fl_addmul_pre 7669420119
subii 7677403098
shift_left 7694728214
uutoi 8935440163
icopy 9059882823
maxss 9713027055
utoi 12052134367
addii 12497564779
evalexpo 13161408405
utoipos 14263210783
gc_const 15500214377
cgetipos 16430755711
cgetg 24635037755
cgeti 27277525844
new_chunk 93662622036
evallg 95429831458
set_avma 129523697646

Generated by: LCOV version 1.16