diff options
author | Samuel Tardieu <sam@rfc1149.net> | 2008-05-20 20:24:33 +0000 |
---|---|---|
committer | Samuel Tardieu <sam@gcc.gnu.org> | 2008-05-20 20:24:33 +0000 |
commit | e4ae405a3508cd881d708465fd9fd167a7cc1c28 (patch) | |
tree | 494f8d2e83a30da4b21430267af318af77f1fbf9 /gcc | |
parent | 9857228c4ca42e03fb12177065a14b5dadaf7e00 (diff) | |
download | gcc-e4ae405a3508cd881d708465fd9fd167a7cc1c28.zip gcc-e4ae405a3508cd881d708465fd9fd167a7cc1c28.tar.gz gcc-e4ae405a3508cd881d708465fd9fd167a7cc1c28.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/modular.adb | 16 |
2 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0ff1a09..c494086 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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> diff --git a/gcc/testsuite/gnat.dg/modular.adb b/gcc/testsuite/gnat.dg/modular.adb new file mode 100644 index 0000000..1eff333 --- /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; |