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-25 09:26:46 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 44309
sdivsi 102146
stack_calloc 110666
gc_stoi 155900
dvdui 167195
subis 171735
Fl_ellj_pre 238054
mindd 264380
truedivis 268374
cmpri 302870
mod16 307013
Mod32 311108
uutoineg 362668
Mod16 389733
mpdiv 395375
cgetg_block 424561
gc_utoi 468756
dvdiu 576276
umodui 711392
cmpsr 796117
rdivss 839647
real2n 1068647
addri 1106273
equalis 1151268
equalsi 1151450
gc_utoipos 1153593
real_0 1157810
mpround 1216578
absrnz_equal2n 1301152
cmpss 1392943
Mod8 2073902
mpcmp 2156190
Mod2 2370234
udivuu_rem 2418379
gc_int 2739331
mulru 2765892
subir 3000046
equalui 3021823
equaliu 3021824
itou_or_0 3147016
maxdd 3211852
cmpis 3634529
negr 3683277
cmpsi 3866529
ceildivuu 3904250
Fl_center 4486164
absrnz_equal1 4556900
real_1_bit 4714274
mod4 5140999
subri 6055460
subsi 6184589
truedivsi 6202318
umuluu_or_0 6263876
affsi 6446430
maxuu 6611112
mulrs 7181596
fractor 7380431
umuluu_le 7617880
gc_NULL 7961546
cmpir 9461265
ugcdiu 10320895
affectsign_safe 10729867
uabsdiviu_rem 11892741
addrs 12364076
smodss 12520258
cmpiu 12981957
cmpui 12982153
rdivii 13106299
rdiviiz 13152253
mpabs_shallow 13428463
divii 14043069
utor 14266533
affur 14266656
mod8 15585586
subrs 16544421
dvdii 16900271
Fl_halve 18772395
modis 19638526
int_bit 20967509
smodis 21176088
hammingu 24048808
evalvalser 24359582
abscmpui 32244409
abscmpiu 32244537
mulri 38307235
mpexpo 38875591
absequaliu 39546715
absequalui 41296739
Mod4 43853721
itos_or_0 44912024
modsi 45242146
affui 45491533
Fl_div 46761028
stack_malloc 46924365
umodi2n 48997026
sdivsi_rem 51446760
gc_ulong 51693470
truedivii 54709532
stack_malloc_align 55535154
affrr_fixlg 56115688
absi_shallow 56286655
gc_bool 56792198
mod2 62591529
Fl_addmulmul_pre 64609187
minuu 69674918
remlll_pre 75648070
evalprecp 78672902
evalvalp 81629508
Fl_triple 87386480
mpsqr 90783549
addiu 96549758
Fl_sqr 99529213
addui 100624856
fixlg 105855550
mod2BIL 107451979
mpodd 116095185
icopyspec 118027105
subiu 133460448
real_1 133685994
subui 138437666
mpshift 153469015
togglesign_safe 157242968
dvmduBIL 165711921
itou 179081403
gc_double 184176814
shiftr 188191234
vali 191179830
addis 194788971
varncmp 199457155
gc_long 242673866
mpsub 249720036
utoineg 298136182
cgetineg 298996636
rtor 303784903
addsi 319975306
muliu 373351853
Fl_double 443206598
shiftr_inplace 466943688
mulis 467117225
itos 476288306
addir 482806951
real_0_bit 484233486
affsr 501438689
stor 501751485
mpadd 574395066
negi 641044561
itor 716819141
Fl_neg 728937689
umodsu 734178029
expu 797129382
stoi 799131913
lg2prec 815886197
mpmul 837146880
rcopy 916901105
mpneg 926921483
affii 964714225
subrr 1006492386
cmpuu 1490537838
cgetg_copy 1492191463
cgetr 1875943022
togglesign 1953736794
minss 2027713096
absi 2069115804
mpabs 2140085469
setabssign 2207401106
Fl_sqr_pre 2338027219
nbits2lg 2405112591
expi 2425372989
Fl_mul 2435217756
addrr 2933065871
remii 3062328374
adduu 3447842849
stackdummy 3683624964
Fl_mul_pre 4223250106
leafcopy 5064564389
shift_right 5732694665
Fl_add 6149633581
dvmdsBIL 7150156642
Fl_sub 7396536654
Fl_addmul_pre 7664274171
subii 7719001332
shift_left 7798087261
uutoi 8937935879
icopy 9155331344
maxss 9703041982
utoi 12052179757
addii 12532869814
evalexpo 13397215827
utoipos 14267504492
gc_const 15653782849
cgetipos 16449603483
cgetg 25519373618
cgeti 27478592750
new_chunk 95135228237
evallg 96859916425
set_avma 131355629294

Generated by: LCOV version 1.16