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
This commit is contained in:
Samuel Tardieu 2008-05-20 20:24:33 +00:00 committed by Samuel Tardieu
parent 9857228c4c
commit e4ae405a35
2 changed files with 21 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2008-05-20 Samuel Tardieu <sam@rfc1149.net>
PR ada/30740
* gnat.dg/modular.adb: New test.
2008-05-20 Jan Sjodin <jan.sjodin@amd.com>
Sebastian Pop <sebastian.pop@amd.com>

View file

@ -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;