2 -- { dg-options "-O2" }
4 with Ada
.Calendar
.Formatting
;
6 procedure Calendar_Format_Value
is
7 Limit
: constant Duration
8 := 99 * 3600.0 + 59 * 60.0 + 59.0;
11 Image
: constant String := Ada
.Calendar
.Formatting
.Image
(Limit
);
12 Image_Error
: exception;
14 if Image
/= "99:59:59" then
15 raise Image_Error
with "image: " & Image
;
18 Value
: constant Duration := Ada
.Calendar
.Formatting
.Value
(Image
);
19 Value_Error
: exception;
21 if Value
/= Limit
then
22 raise Value_Error
with "duration: " & Value
'Image;
26 end Calendar_Format_Value
;