PR target/84336
[official-gcc.git] / gcc / testsuite / gnat.dg / modular3.adb
blob539edcaf4d4144b642f0a9980d4f9b294435993e
1 -- { dg-do run }
3 with Modular3_Pkg; use Modular3_Pkg;
5 procedure Modular3 is
7 function F1 (A : Int16_T) return Int16_T is
8 begin
9 return A + 128;
10 end;
12 function F2 (B : Mod16_T) return Mod16_T is
13 begin
14 return B + 128;
15 end;
17 A : Int16_T := 16384;
18 B : Mod16_T := 65504;
20 begin
22 A := F1 (A);
23 if A /= 16512 then
24 raise Program_Error;
25 end if;
27 B := F2 (B);
28 if B /= 96 then
29 raise Program_Error;
30 end if;
32 end Modular3;