Commit e4ae405a by Samuel Tardieu Committed by Samuel Tardieu

re PR ada/30740 (Improper semantics in gnat's compilation of certain expressions…

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
parent 9857228c
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> 2008-05-20 Jan Sjodin <jan.sjodin@amd.com>
Sebastian Pop <sebastian.pop@amd.com> Sebastian Pop <sebastian.pop@amd.com>
......
-- { 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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment