gcc/cp
[official-gcc.git] / gcc / testsuite / gnat.dg / exp0_eval.adb
blob11edd7d097c225a7e795cde5ce579347990eea3c
1 -- { dg-do run }
2 with Interfaces; use Interfaces;
3 procedure Exp0_Eval is
5 F_Count : Natural := 0;
7 function F return Integer is
8 begin
9 F_Count := F_Count + 1;
10 return 1;
11 end F;
13 function F return Unsigned_32 is
14 begin
15 F_Count := F_Count + 1;
16 return 1;
17 end F;
19 R : constant Integer :=
20 F ** 0 +
21 F * 0 +
22 0 * F +
23 Integer (Unsigned_32'(F) mod 1) +
24 Integer (Unsigned_32'(F) rem 1);
25 pragma Warnings (Off, R);
26 begin
27 if F_Count /= 5 then
28 raise Program_Error
29 with "incorrect numbers of calls to F:" & F_Count'Img;
30 end if;
31 end Exp0_Eval;