Debian Codegraph @

gcc/testsuite/gnat.dg/fixedpnt8.adb

raw
1 -- { dg-do compile }
2
3 procedure Fixedpnt8 is
4
5 Ct_A : constant := 0.000_000_100;
6 Ct_B : constant := 0.000_000_025;
7
8 Ct_C : constant := 1_000;
9
10 type Number_Type is range 0 .. Ct_C;
11
12 subtype Index_Type is Number_Type range 1 .. Number_Type'Last;
13
14 type Kind_Enumerated_Type is
15 (A1,
16 A2);
17
18 Kind : Kind_Enumerated_Type := A1;
19
20 V : Duration := 10.0;
21
22 Last : constant Index_Type :=
23 Index_Type (V / (case Kind is -- { dg-warning "universal_fixed expression interpreted as type \"Standard.Duration\"" }
24 when A1 => Ct_B,
25 when A2 => Ct_A));
26 begin
27 null;
28 end Fixedpnt8;