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 30831-19b50a36d0) Lines: 607 680 89.3 %
Date: 2026-04-23 09:26:12 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 44301
sdivsi 102150
stack_calloc 110682
gc_stoi 155901
dvdui 167195
subis 171740
Fl_ellj_pre 238062
mindd 264381
truedivis 268362
cmpri 302870
mod16 307030
Mod32 311108
uutoineg 362537
Mod16 389733
mpdiv 395374
cgetg_block 423638
gc_utoi 468741
dvdiu 576268
umodui 711392
cmpsr 796111
rdivss 839647
real2n 1068658
addri 1106275
equalis 1151155
equalsi 1151337
gc_utoipos 1153570
real_0 1157832
mpround 1216586
absrnz_equal2n 1301124
cmpss 1392943
Mod8 2073849
mpcmp 2156201
Mod2 2370099
udivuu_rem 2418379
gc_int 2739338
mulru 2765892
subir 3000076
equaliu 3021814
equalui 3021815
itou_or_0 3147014
maxdd 3211527
cmpis 3634438
negr 3683425
cmpsi 3866440
ceildivuu 3902263
Fl_center 4486195
absrnz_equal1 4556845
real_1_bit 4714226
mod4 5140779
subri 6064532
subsi 6184766
truedivsi 6202318
umuluu_or_0 6307207
affsi 6446392
maxuu 6610919
mulrs 7181596
fractor 7380431
umuluu_le 7617880
gc_NULL 7961455
cmpir 9460680
ugcdiu 10320746
affectsign_safe 10730184
uabsdiviu_rem 11892741
addrs 12364023
smodss 12517964
cmpiu 12985774
cmpui 12986170
rdivii 13105973
rdiviiz 13150420
mpabs_shallow 13428463
divii 14069714
utor 14266541
affur 14266647
mod8 15588214
subrs 16544367
dvdii 16891596
Fl_halve 18771808
modis 19638526
int_bit 20974988
smodis 21176088
hammingu 24048701
evalvalser 24359582
abscmpui 32331823
abscmpiu 32331980
mulri 38307281
mpexpo 38876687
absequaliu 39546240
absequalui 41296261
Mod4 43851662
itos_or_0 44911348
modsi 45242133
affui 45491532
Fl_div 46707543
stack_malloc 46924523
umodi2n 48994783
sdivsi_rem 51446743
gc_ulong 51681278
truedivii 54736070
stack_malloc_align 55536560
affrr_fixlg 56115708
absi_shallow 56373755
gc_bool 56793083
mod2 62589959
Fl_addmulmul_pre 64606554
minuu 69694020
remlll_pre 75883967
evalprecp 78676025
evalvalp 81632518
Fl_triple 87484968
mpsqr 90787992
addiu 96730369
Fl_sqr 99474573
addui 100805413
fixlg 105855538
mod2BIL 107452507
mpodd 116092791
icopyspec 118026748
subiu 133462832
real_1 133689437
subui 138439963
mpshift 153524261
togglesign_safe 157325043
dvmduBIL 165590568
itou 179080332
gc_double 184104981
shiftr 188193388
vali 191177926
addis 194784784
varncmp 199456801
gc_long 242674935
mpsub 249772562
utoineg 298151529
cgetineg 299012879
rtor 303782398
addsi 319971081
muliu 373380291
Fl_double 443388057
shiftr_inplace 466960650
mulis 467136778
itos 476309507
addir 482811144
real_0_bit 484151886
affsr 501432786
stor 501745934
mpadd 574402825
negi 641001881
itor 716817602
Fl_neg 729025796
umodsu 734162670
expu 797117076
stoi 799168069
lg2prec 815973863
mpmul 837206220
rcopy 916896686
mpneg 926887039
affii 965385497
subrr 1006583530
cmpuu 1490494589
cgetg_copy 1492140226
cgetr 1875879898
togglesign 1953914134
minss 2028213363
absi 2068829589
mpabs 2139790094
setabssign 2207097415
Fl_sqr_pre 2338501956
nbits2lg 2404413090
expi 2425497615
Fl_mul 2435563036
addrr 2933588865
remii 3063923131
adduu 3448804747
stackdummy 3682453594
Fl_mul_pre 4221199988
leafcopy 5064116247
shift_right 5732320500
Fl_add 6151711925
dvmdsBIL 7151137550
Fl_sub 7392358403
Fl_addmul_pre 7659072795
subii 7722263057
shift_left 7797703691
uutoi 8940426062
icopy 9158200169
maxss 9700362250
utoi 12052505150
addii 12538233987
evalexpo 13402262833
utoipos 14269212770
gc_const 15655870858
cgetipos 16453681547
cgetg 25526516714
cgeti 27502665547
new_chunk 95176938381
evallg 96901937828
set_avma 131417246450

Generated by: LCOV version 1.16