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-20 09:27:00 Functions: 214 238 89.9 %
Legend: Lines: hit not hit

Function Name Sort by function name Hit count Sort by hit count
Fl_add 6141826570
Fl_addmul_pre 7660451366
Fl_addmulmul_pre 64589569
Fl_center 4486079
Fl_div 46727272
Fl_double 442387539
Fl_ellj_pre 238053
Fl_halve 18762491
Fl_mul 2437307872
Fl_mul_pre 4226091919
Fl_neg 729034265
Fl_sqr 99447711
Fl_sqr_pre 2336676772
Fl_sub 7418291504
Fl_triple 87278033
Mod16 389733
Mod2 2370028
Mod32 311108
Mod4 43850680
Mod64 0
Mod8 2073678
abscmpiu 33351870
abscmpui 33351770
absequaliu 39545703
absequalui 41295737
absi 2068951200
absi_shallow 57393102
absr 20510
absrnz_equal1 4556888
absrnz_equal2n 1301148
addii 12537983494
addir 482819257
addis 194781957
addiu 98769331
addri 1106188
addrr 2931621402
addrs 12364043
addsi 319968523
addss 25067
addui 102844385
adduu 3451700207
affectsign 0
affectsign_safe 10728615
affii 965651926
affrr_fixlg 56116151
affsi 6446227
affsr 501391567
affui 45491532
affur 14266567
ceildivuu 3901917
cgetg 25530084601
cgetg_block 423644
cgetg_copy 1492131816
cgeti 27500903406
cgetineg 298989202
cgetipos 16459367739
cgetr 1875894949
cgetr_block 44241
cmpir 9446934
cmpis 3634404
cmpiu 12984223
cmpri 302870
cmprs 40996
cmpsi 3866410
cmpsr 796102
cmpss 1392943
cmpui 12983981
cmpuu 1490489583
divii 14049330
divsi_rem 0
divss 0
divss_rem 0
dvdii 16903823
dvdiiz 0
dvdis 33737
dvdisz 0
dvdiu 576278
dvdiuz 0
dvdsi 371
dvdui 167195
dvmdis 0
dvmdsBIL 7150494549
dvmdsi 0
dvmdss 0
dvmduBIL 165689793
equalis 1151329
equaliu 3021831
equalsi 1151511
equalui 3021831
evalexpo 13398743939
evallg 96908172221
evalprecp 78672955
evalvalp 81629482
evalvalser 24359582
expi 2425844246
expu 797090521
fixlg 105855889
fractor 7380431
gc_NULL 7962470
gc_bool 56800209
gc_const 15654608036
gc_double 184148225
gc_int 2739310
gc_long 242672640
gc_stoi 155905
gc_ulong 51670130
gc_utoi 468747
gc_utoipos 1153578
get_avma 0
hammingu 24048769
icopy 9157630261
icopyspec 118027118
int_bit 20955126
itor 716835045
itos 476311638
itos_or_0 44912445
itou 179080913
itou_or_0 3147012
leafcopy 5064227593
lg2prec 815973008
maxdd 3211544
maxss 9727310277
maxuu 6611005
mindd 264378
minss 2028120420
minuu 69661246
mod16 307025
mod2 62590126
mod2BIL 107442554
mod32 259
mod4 5140468
mod64 0
mod8 15582559
modis 19638526
modsi 45242177
modss 0
mpabs 2139883593
mpabs_shallow 13428463
mpadd 572642602
mpceil 0
mpcmp 2156167
mpcopy 665
mpdiv 395374
mpexpo 38876119
mpfloor 0
mpmul 835389977
mpneg 926985281
mpodd 116094215
mpround 1216581
mpshift 153501731
mpsqr 90775727
mpsub 249726054
mptrunc 49
mulis 467114765
muliu 373344105
mulri 38307239
mulrs 7181596
mulru 2765892
nbits2lg 2402989485
negi 641103861
negr 3683296
new_chunk 95171389693
rcopy 916875426
rdivii 13107300
rdiviiz 13151597
rdivis 0
rdivsi 0
rdivss 839647
real2n 1068651
real_0 1157792
real_0_bit 482220489
real_1 133704926
real_1_bit 4714136
real_m1 455
real_m2n 126
remii 3062654985
remis 0
remlll_pre 75645352
remsi 0
remss 0
rtor 303778338
sdivsi 102150
sdivsi_rem 51446791
sdivss_rem 0
set_avma 131417241535
setabssign 2207191976
shift_left 7797591481
shift_right 5731549781
shiftl 0
shiftlr 0
shiftr 188188953
shiftr_inplace 467001714
smodis 21176088
smodss 12534368
stack_calloc 110704
stack_calloc_align 3325
stack_malloc 46923583
stack_malloc_align 55535930
stackdummy 3688881669
stoi 799079839
stor 501724848
subii 7721584356
subir 3000029
subis 171739
subiu 133462397
subri 6090094
subrr 1006461035
subrs 16544350
subsi 6184746
subss 25067
subui 138439724
subuu 25067
thuemorseu 3313
togglesign 1953989612
togglesign_safe 157262267
truedivii 54734850
truedivis 268375
truedivsi 6202318
uabsdiviu_rem 11892741
uabsdivui_rem 16693
udivuu_rem 2418379
ugcdiu 10320754
ugcdui 2737
umodi2n 48993708
umodsu 734142381
umodui 711392
umuluu_le 7617880
umuluu_or_0 6260588
utoi 12059187090
utoineg 298128601
utoipos 14275982975
utor 14266467
uutoi 8944281785
uutoineg 362408
vali 191179079
varncmp 199456634
varnmax 203
varnmin 10374

Generated by: LCOV version 1.16