From: Samuel Tardieu Date: Tue, 20 May 2008 20:24:33 +0000 (+0000) Subject: re PR ada/30740 (Improper semantics in gnat's compilation of certain expressions... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e4ae405a3508cd881d708465fd9fd167a7cc1c28;p=gcc.git re PR ada/30740 (Improper semantics in gnat's compilation of certain expressions involving modular arithmetic) gcc/testsuite/ PR ada/30740 * gnat.dg/modular.adb: New test. From-SVN: r135675 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0ff1a091d54..c49408661e6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-05-20 Samuel Tardieu + + PR ada/30740 + * gnat.dg/modular.adb: New test. + 2008-05-20 Jan Sjodin Sebastian Pop diff --git a/gcc/testsuite/gnat.dg/modular.adb b/gcc/testsuite/gnat.dg/modular.adb new file mode 100644 index 00000000000..1eff3332708 --- /dev/null +++ b/gcc/testsuite/gnat.dg/modular.adb @@ -0,0 +1,16 @@ +-- { dg-do run } +with Ada.Text_IO; +procedure Modular is + type T1 is mod 9; + package T1_IO is new Ada.Text_IO.Modular_IO(T1); + X: T1 := 8; + J1: constant := 5; +begin + for J2 in 5..5 loop + pragma Assert(X*(2**J1) = X*(2**J2)); + if X*(2**J1) /= X*(2**J2) then + Ada.Text_IO.Put_Line("Failed"); + raise Program_Error; + end if; + end loop; +end Modular;