* 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
2008-05-28 Arnaud Charlet <charlet@adacore.com>
+ * 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 <hutchinsonandy@aim.com>
+-- { dg-options "-gnatws" }
+
procedure Deep_Old (X : Integer) is
begin
begin
--- /dev/null
+-- { 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;
--- /dev/null
+-- { dg-do compile }
+-- { dg-options "-gnatws" }
+with FRUnaligned1; use FRUnaligned1;
+function FRUnaligned return r is
+ ss : s;
+begin
+ return ss.y;
+end;
--- /dev/null
+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;
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