From aa94ab941251a643ab8e4a765b721acebecadd44 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Wed, 28 May 2008 13:20:22 +0000 Subject: [PATCH] old_errors.adb, [...]: Adjust. * gnat.dg/old_errors.adb, gnat.dg/deep_old.adb: Adjust. * gnat.dg/fixce.adb: New test. * gnat.dg/frunaligned*.ad[sb]: New test. From-SVN: r136082 --- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gnat.dg/deep_old.adb | 2 ++ gcc/testsuite/gnat.dg/fixce.adb | 13 +++++++++++++ gcc/testsuite/gnat.dg/frunaligned.adb | 8 ++++++++ gcc/testsuite/gnat.dg/frunaligned1.ads | 12 ++++++++++++ gcc/testsuite/gnat.dg/old_errors.adb | 2 +- 6 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gnat.dg/fixce.adb create mode 100644 gcc/testsuite/gnat.dg/frunaligned.adb create mode 100644 gcc/testsuite/gnat.dg/frunaligned1.ads diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1bfa4d20e05..7533e378718 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,8 +1,12 @@ 2008-05-28 Arnaud Charlet + * gnat.dg/old_errors.adb, gnat.dg/deep_old.adb: Adjust. + * gnat.dg/specs/iface_eq_test.ads, gnat.dg/specs/iface_eq_test-child.ads: New test. * gnat.dg/specs/self_class.ads: New test. + * gnat.dg/fixce.adb: New test. + * gnat.dg/frunaligned*.ad[sb]: New test. 2008-05-27 Andy Hutchinson diff --git a/gcc/testsuite/gnat.dg/deep_old.adb b/gcc/testsuite/gnat.dg/deep_old.adb index 6aca027f4ac..d7818ff9686 100644 --- a/gcc/testsuite/gnat.dg/deep_old.adb +++ b/gcc/testsuite/gnat.dg/deep_old.adb @@ -1,3 +1,5 @@ +-- { dg-options "-gnatws" } + procedure Deep_Old (X : Integer) is begin begin diff --git a/gcc/testsuite/gnat.dg/fixce.adb b/gcc/testsuite/gnat.dg/fixce.adb new file mode 100644 index 00000000000..91e02e79383 --- /dev/null +++ b/gcc/testsuite/gnat.dg/fixce.adb @@ -0,0 +1,13 @@ +-- { dg-do run } + +procedure fixce is + type D is delta 128.0 / (2 ** 15) range 0.0 .. 256.0; + type R is range 0 .. 200; + dd : D; + RA : constant array (1 .. 3) of R := (127, 128, 200); +begin + dd := D (RA (2)); + for i in RA'range loop + dd := D (RA (i)); + end loop; +end fixce; diff --git a/gcc/testsuite/gnat.dg/frunaligned.adb b/gcc/testsuite/gnat.dg/frunaligned.adb new file mode 100644 index 00000000000..a57e87227e0 --- /dev/null +++ b/gcc/testsuite/gnat.dg/frunaligned.adb @@ -0,0 +1,8 @@ +-- { dg-do compile } +-- { dg-options "-gnatws" } +with FRUnaligned1; use FRUnaligned1; +function FRUnaligned return r is + ss : s; +begin + return ss.y; +end; diff --git a/gcc/testsuite/gnat.dg/frunaligned1.ads b/gcc/testsuite/gnat.dg/frunaligned1.ads new file mode 100644 index 00000000000..4a8db361b48 --- /dev/null +++ b/gcc/testsuite/gnat.dg/frunaligned1.ads @@ -0,0 +1,12 @@ +package FRUnaligned1 is + type r is array (1 .. 72) of Boolean; + pragma Pack (r); + type s is record + x : Boolean; + y : r; + end record; + for s use record + x at 0 range 0 .. 0; + y at 0 range 1 .. 72; + end record; +end FRUnaligned1; diff --git a/gcc/testsuite/gnat.dg/old_errors.adb b/gcc/testsuite/gnat.dg/old_errors.adb index 846c6c61f25..a5e4d42177f 100644 --- a/gcc/testsuite/gnat.dg/old_errors.adb +++ b/gcc/testsuite/gnat.dg/old_errors.adb @@ -37,7 +37,7 @@ package body Old_Errors is begin Y := Z'Old; -- { dg-error "cannot refer to local variable" } end; - Y := I'Old; -- OK + Y := I'Old; -- { dg-warning "Old applied to constant has no effect" } Y := O'Old; -- OK Y := IO'Old; -- OK Y := G; -- OK, error has been signalled at G declaration -- 2.30.2