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 30702-bddb8d6928) Lines: 605 680 89.0 %
Date: 2026-02-23 02:23:56 Functions: 214 238 89.9 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Fl_add 3624683547
Fl_addmul_pre 6693434313
Fl_addmulmul_pre 49744743
Fl_center 3490150
Fl_div 39579886
Fl_double 356321675
Fl_ellj_pre 179549
Fl_halve 14465234
Fl_mul 1938757473
Fl_mul_pre 3425206185
Fl_neg 616999750
Fl_sqr 77231707
Fl_sqr_pre 1688500016
Fl_sub 5852691965
Fl_triple 72562056
Mod16 327088
Mod2 2027970
Mod32 266664
Mod4 36592377
Mod64 0
Mod8 1673139
abscmpiu 28174563
abscmpui 28174563
absequaliu 33543225
absequalui 35042269
absi 1725083305
absi_shallow 49068409
absr 100
absrnz_equal1 3830341
absrnz_equal2n 1077438
addii 10395165499
addir 402044393
addis 143162871
addiu 82778221
addri 925505
addrr 2410570040
addrs 10476621
addsi 250290470
addss 21486
addui 84919076
adduu 2766750132
affectsign 0
affectsign_safe 8533286
affii 745381709
affrr_fixlg 45236720
affsi 5253328
affsr 407829404
affui 33744700
affur 10813177
ceildivuu 3185921
cgetg 20491881291
cgetg_block 44861
cgetg_copy 1245562598
cgeti 20877332073
cgetineg 247101103
cgetipos 13098920927
cgetr 1531895652
cgetr_block 3656
cmpir 7832183
cmpis 3107502
cmpiu 6856031
cmpri 230086
cmprs 34919
cmpsi 3306214
cmpsr 673153
cmpss 1059249
cmpui 6856031
cmpuu 1197049916
divii 11181201
divsi_rem 0
divss 0
divss_rem 0
dvdii 12794185
dvdiiz 0
dvdis 28836
dvdisz 0
dvdiu 494022
dvdiuz 0
dvdsi 286
dvdui 143306
dvmdis 0
dvmdsBIL 5851557934
dvmdsi 0
dvmdss 0
dvmduBIL 136111929
equalis 983728
equaliu 2550044
equalsi 983859
equalui 2550044
evalexpo 11017660427
evallg 78695982629
evalprecp 67423419
evalvalp 69956491
evalvalser 18411676
expi 1949005283
expu 650206445
fixlg 87398918
fractor 5523309
gc_NULL 6665495
gc_bool 41164113
gc_const 13900323115
gc_double 150241869
gc_int 1911030
gc_long 190789933
gc_stoi 133336
gc_ulong 42676272
gc_utoi 401718
gc_utoipos 979913
get_avma 0
hammingu 20484723
icopy 7150163424
icopyspec 101614223
int_bit 15987481
itor 591932732
itos 368276512
itos_or_0 37245339
itou 150810051
itou_or_0 2524613
leafcopy 4150529382
lg2prec 671096114
maxdd 2692033
maxss 7936918294
maxuu 4126632
mindd 204608
minss 1643243574
minuu 41329927
mod16 174008
mod2 50132098
mod2BIL 83589747
mod32 187
mod4 4295323
mod64 0
mod8 10062309
modis 16833310
modsi 33316618
modss 0
mpabs 1782965872
mpabs_shallow 9598030
mpadd 474988720
mpceil 0
mpcmp 1851601
mpcopy 564
mpdiv 523653
mpexpo 31873531
mpfloor 0
mpmul 691309038
mpneg 753921196
mpodd 97319059
mpround 921326
mpshift 129958449
mpsqr 74633286
mpsub 205174842
mptrunc 38
mulis 387284599
muliu 335958691
mulri 32472753
mulrs 5084091
mulru 1992801
nbits2lg 1962151908
negi 522198706
negr 3090526
new_chunk 77216071081
rcopy 758961228
rdivii 10340988
rdiviiz 10372549
rdivis 0
rdivsi 0
rdivss 599747
real2n 905385
real_0 961142
real_0_bit 402281083
real_1 107775595
real_1_bit 4000883
real_m1 381
real_m2n 108
remii 2360748725
remis 0
remlll_pre 65177969
remsi 0
remss 0
rtor 247432141
sdivsi 87241
sdivsi_rem 38634594
sdivss_rem 0
set_avma 108014489104
setabssign 1838701737
shift_left 6725820075
shift_right 4776038530
shiftl 0
shiftlr 0
shiftr 151126326
shiftr_inplace 382810432
smodis 17967081
smodss 10732377
stack_calloc 91302
stack_calloc_align 2644
stack_malloc 37021281
stack_malloc_align 45873505
stackdummy 3040167622
stoi 584152154
stor 407829404
subii 6099872227
subir 2202564
subis 142886
subiu 111827354
subri 5104585
subrr 831503293
subrs 14028272
subsi 4728433
subss 21486
subui 115992049
subuu 21486
thuemorseu 2444
togglesign 1570911798
togglesign_safe 97350039
truedivii 37343919
truedivis 228035
truedivsi 5316014
uabsdiviu_rem 10193778
uabsdivui_rem 12827
udivuu_rem 2066551
ugcdiu 8647289
ugcdui 2346
umodi2n 40887322
umodsu 626746196
umodui 1108941
umuluu_le 4853944
umuluu_or_0 4368282
utoi 9422835451
utoineg 246271069
utoipos 11240063535
utor 10813077
uutoi 6869283830
uutoineg 315862
vali 162429792
varncmp 182156248
varnmax 174
varnmin 12624

Generated by: LCOV version 1.16