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 30754-316d984fc8) Lines: 605 680 89.0 %
Date: 2026-03-19 09:26:57 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 19040
addss 25067
subss 25067
subuu 25067
dvdis 33730
cmprs 40996
cgetr_block 44245
sdivsi 102151
stack_calloc 110699
gc_stoi 155901
dvdui 167195
subis 171740
Fl_ellj_pre 238045
mindd 264382
truedivis 268382
cmpri 284263
mod16 307021
Mod32 311108
uutoineg 363687
Mod16 389733
cgetg_block 426286
gc_utoi 468833
dvdiu 576274
mpdiv 665525
cmpsr 796095
rdivss 839647
real2n 1068603
addri 1106166
equalis 1151254
equalsi 1151436
gc_utoipos 1153567
real_0 1157703
mpround 1216581
umodui 1290952
absrnz_equal2n 1300286
cmpss 1392943
Mod8 2074293
mpcmp 2226336
Mod2 2370289
udivuu_rem 2418379
gc_int 2742548
mulru 2765892
subir 3004973
equaliu 3021729
equalui 3021730
itou_or_0 3147022
maxdd 3211398
cmpis 3634440
negr 3682968
cmpsi 3866443
ceildivuu 3902547
Fl_center 4486113
absrnz_equal1 4553088
real_1_bit 4714002
mod4 5141057
subri 6064655
subsi 6184690
truedivsi 6202031
umuluu_or_0 6249623
affsi 6446177
maxuu 6610871
mulrs 7181596
fractor 7379025
umuluu_le 7617880
gc_NULL 7962587
cmpir 9457601
ugcdiu 10320886
affectsign_safe 10731429
uabsdiviu_rem 11892741
addrs 12360661
smodss 12604760
cmpiu 12985412
cmpui 12987412
rdivii 13107544
rdiviiz 13149575
mpabs_shallow 13428463
divii 14060190
utor 14335009
affur 14335094
mod8 15587324
subrs 16536392
dvdii 16898532
Fl_halve 18812701
modis 19638526
int_bit 20939568
smodis 21176081
hammingu 24048772
evalvalser 24359582
abscmpiu 32325013
abscmpui 32325105
mulri 38284838
mpexpo 38874428
absequaliu 39540813
absequalui 41290813
Mod4 43860380
itos_or_0 44910966
modsi 45242098
affui 45491533
Fl_div 46815251
stack_malloc 46928796
umodi2n 49004813
sdivsi_rem 51446418
gc_ulong 52071532
truedivii 54740449
stack_malloc_align 55534378
affrr_fixlg 56110644
gc_bool 56169832
absi_shallow 56375148
mod2 61682617
Fl_addmulmul_pre 64713465
minuu 69700439
remlll_pre 76306433
evalprecp 78674405
evalvalp 81630929
mpsqr 91040907
Fl_triple 91249813
addiu 96700109
Fl_sqr 99528778
addui 100775226
fixlg 105721204
mod2BIL 106543326
mpodd 115187007
icopyspec 117797709
subiu 133391641
real_1 133620042
subui 138367649
mpshift 153579650
togglesign_safe 157353515
dvmduBIL 158889544
itou 179067902
gc_double 184172740
shiftr 187872249
vali 190835463
addis 194700193
varncmp 198759230
gc_long 242622930
mpsub 251602875
utoineg 297828872
cgetineg 298689193
rtor 303762748
addsi 319886261
muliu 376487878
Fl_double 453228838
mulis 467127736
shiftr_inplace 467552082
itos 476318049
addir 483052522
real_0_bit 484289979
affsr 501371500
stor 501724801
mpadd 574695154
negi 640933589
itor 717135827
Fl_neg 723652712
umodsu 734156551
expu 796768618
stoi 797341040
lg2prec 816183044
mpmul 838987743
rcopy 916751802
mpneg 926536743
affii 965767746
subrr 1006450967
cgetg_copy 1481802183
cmpuu 1490468525
cgetr 1876363429
togglesign 1953916161
minss 2026552963
absi 2067013913
mpabs 2137987702
setabssign 2205043148
Fl_sqr_pre 2346771052
nbits2lg 2404536672
expi 2423421316
Fl_mul 2439083677
addrr 2934188941
remii 3059776468
adduu 3448504082
stackdummy 3658065298
Fl_mul_pre 4232529606
leafcopy 5002562298
shift_right 5737230644
Fl_add 6138084852
dvmdsBIL 7153725487
Fl_sub 7417527776
Fl_addmul_pre 7664445510
subii 7719831625
shift_left 7799905475
uutoi 8948827839
icopy 9067202825
maxss 9710825263
utoi 12066441399
addii 12548968845
evalexpo 13403643367
utoipos 14282351385
gc_const 15648386764
cgetipos 16466268653
cgetg 25456094093
cgeti 27489956755
new_chunk 94934449261
evallg 96691023171
set_avma 131157236260

Generated by: LCOV version 1.16