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 30735-65f72320ad) Lines: 605 680 89.0 %
Date: 2026-03-12 09:23:43 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 10374
uabsdivui_rem 16693
addss 25067
subss 25067
subuu 25067
dvdis 33730
cmprs 40996
cgetr_block 43810
sdivsi 102149
stack_calloc 110582
gc_stoi 155898
dvdui 167195
subis 171739
Fl_ellj_pre 238048
mindd 264380
truedivis 266988
cmpri 282310
mod16 307012
Mod32 311108
uutoineg 363664
Mod16 389733
cgetg_block 425290
gc_utoi 468830
dvdiu 576277
mpdiv 665536
cmpsr 796106
rdivss 839647
real2n 1067465
addri 1106227
equalis 1150880
equalsi 1151063
gc_utoipos 1153596
real_0 1156621
mpround 1216578
umodui 1290953
absrnz_equal2n 1292534
cmpss 1392943
Mod8 2074129
mpcmp 2226298
Mod2 2370182
udivuu_rem 2418379
gc_int 2631185
mulru 2765892
subir 3004980
equaliu 3018943
equalui 3018943
itou_or_0 3147009
maxdd 3179272
cmpis 3633606
negr 3671752
cmpsi 3865606
ceildivuu 3903302
Fl_center 4486084
absrnz_equal1 4520203
real_1_bit 4707073
maxuu 4815310
mod4 5139304
umuluu_le 5803291
subri 6092869
umuluu_or_0 6155740
subsi 6182960
truedivsi 6202031
affsi 6439490
mulrs 7181596
fractor 7376925
gc_NULL 7962912
cmpir 9433269
ugcdiu 10146754
affectsign_safe 10729275
uabsdiviu_rem 11892741
cmpiu 12180363
cmpui 12180422
addrs 12304978
smodss 12581430
rdivii 13104038
rdiviiz 13146389
mpabs_shallow 13428463
utor 13463046
affur 13463163
divii 14057428
mod8 15578129
subrs 16477845
dvdii 16894157
Fl_halve 18826129
modis 19638526
int_bit 20988352
smodis 21176081
evalvalser 21529069
hammingu 24048779
abscmpiu 32415965
abscmpui 32416013
mulri 38033823
mpexpo 38876342
absequaliu 39352900
absequalui 41101810
itos_or_0 43601511
Mod4 43860668
modsi 45225745
affui 45473825
Fl_div 46558986
stack_malloc 46825374
umodi2n 49004818
sdivsi_rem 51430073
gc_ulong 52077975
affrr_fixlg 54654981
truedivii 54699717
stack_malloc_align 55524434
gc_bool 56136904
absi_shallow 56382259
mod2 61230759
Fl_addmulmul_pre 64697830
minuu 69593335
remlll_pre 76313929
evalprecp 78673699
evalvalp 81630262
mpsqr 91033514
Fl_triple 91210954
addiu 96786392
Fl_sqr 99455116
addui 100433995
fixlg 104201455
mod2BIL 106064424
mpodd 115174595
icopyspec 117468634
real_1 129865664
subiu 131921940
subui 136896397
mpshift 153310509
togglesign_safe 157192598
dvmduBIL 158875218
shiftr 178079245
itou 178236691
gc_double 184156412
addis 184528465
vali 190427839
varncmp 198517251
gc_long 242528473
mpsub 251608709
rtor 295304350
utoineg 297198534
cgetineg 298058994
addsi 309714678
muliu 375696580
Fl_double 453218732
shiftr_inplace 464488537
mulis 467006735
itos 472266448
real_0_bit 477581853
addir 481447634
affsr 486249353
stor 486571058
mpadd 572876612
negi 640386192
itor 715303331
Fl_neg 723760718
umodsu 734180331
expu 775700007
stoi 796742484
lg2prec 800330870
mpmul 836158516
rcopy 903478038
mpneg 920385842
affii 957517987
subrr 1000362670
cgetg_copy 1487225102
cmpuu 1490418761
cgetr 1840985309
togglesign 1943576110
minss 2009625911
absi 2065891955
mpabs 2136734876
Fl_sqr_pre 2156556538
setabssign 2203442839
nbits2lg 2365802949
expi 2421964307
Fl_mul 2429070652
addrr 2876495319
remii 3019792566
adduu 3444187328
stackdummy 3651089152
Fl_mul_pre 4088351396
Fl_add 4396149943
leafcopy 4977715938
shift_right 5633669449
dvmdsBIL 7031938975
Fl_sub 7217948043
Fl_addmul_pre 7670445376
subii 7682745740
shift_left 7694312298
uutoi 8929070303
icopy 9058896774
maxss 9701848340
utoi 12042284552
addii 12542407364
evalexpo 13159608524
utoipos 14254033772
gc_const 15583592592
cgetipos 16416244970
cgetg 24514016892
cgeti 27267635926
new_chunk 93531168869
evallg 95349755362
set_avma 129506604463

Generated by: LCOV version 1.16