  Understanding the link between massive ($\gtrsim 30$ M$_{\odot{}}$) stellar
black holes (BHs) and their progenitor stars is a crucial step to interpret
observations of gravitational-wave events. In this paper, we discuss the final
fate of very massive stars (VMSs), with zero-age main sequence (ZAMS) mass
$>150$ M$_{\odot}$, accounting for pulsational pair-instability supernovae
(PPISNe) and for pair-instability supernovae (PISNe). We describe an updated
version of our population synthesis code SEVN, in which we added stellar
evolution tracks for VMSs with ZAMS mass up to $350 $M$_{\odot{}}$ and we
included analytical prescriptions for PPISNe and PISNe. We use the new version
of SEVN to study the BH mass spectrum at different metallicity $Z$, ranging
from $Z=2.0\times 10^{-4}$ to $Z=2.0\times 10^{-2}$. The main effect of PPISNe
and PISNe is to favour the formation of BHs in the mass range of the first
gravitational-wave event (GW150914), while they prevent the formation of
remnants with mass 60 - 120 M$_{\odot{}}$. In particular, we find that PPISNe
significantly enhance mass loss of metal-poor ($Z\leq 2.0\times 10^{-3}$) stars
with ZAMS mass $60\leq $M$_{\mathrm{ZAMS}}/$M$_{\odot{}}\leq 125$. In contrast,
PISNe become effective only for moderately metal-poor ($Z<8.0\times 10^{-3}$)
VMSs. VMSs with M$_{\rm ZAMS}\gtrsim{}220$ M$_\odot$ and $Z<10^{-3}$ do not
undergo PISNe and form intermediate-mass BHs (IMBHs, with mass $\gtrsim 200
$M$_{\odot{}}$) via direct collapse.
