[gcc r16-1456] ada: Apply tweak for machine-code-based coverage
Marc Poulhies
dkm@gcc.gnu.org
Thu Jun 12 08:40:33 GMT 2025
https://gcc.gnu.org/g:9c446b00d3130853b01bd7ada9b4c54eee13de52
commit r16-1456-g9c446b00d3130853b01bd7ada9b4c54eee13de52
Author: Ronan Desplanques <desplanques@adacore.com>
Date: Mon Apr 7 10:19:24 2025 +0200
ada: Apply tweak for machine-code-based coverage
gcc/ada/ChangeLog:
* libgnat/s-valuer.adb (Scan_Raw_Real): Apply tweak.
Diff:
---
gcc/ada/libgnat/s-valuer.adb | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/gcc/ada/libgnat/s-valuer.adb b/gcc/ada/libgnat/s-valuer.adb
index 2410b6bd4e14..cc1f778ee4ee 100644
--- a/gcc/ada/libgnat/s-valuer.adb
+++ b/gcc/ada/libgnat/s-valuer.adb
@@ -614,7 +614,13 @@ package body System.Value_R is
then
Base_Char := Str (Index);
- if N = 1 and then Value (1) in 2 .. 16 then
+ -- Functionally, "(Parts = 1 or else N = 1)" in the condition of the
+ -- following if statement could replaced by the simpler "N = 1". The
+ -- reason we use a more complicated expression is to accommodate
+ -- machine-code-based coverage tools: the simple version makes it
+ -- impossible to fully cover generic instances of System.Value_R with
+ -- Parts = 1.
+ if (Parts = 1 or else N = 1) and then Value (1) in 2 .. 16 then
Base := Unsigned (Value (1));
else
Base_Violation := True;
More information about the Gcc-cvs
mailing list