diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2009-10-17 11:17:27 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2009-10-17 11:17:27 +0000 |
commit | 431cfac1ffb50746d86afbf486f84180d39c54e8 (patch) | |
tree | d7e70992d9aba30711a5e73fff24f4b4d2d46b90 /gcc/testsuite/gnat.dg | |
parent | 3f273c8a53e786389658f14a0316e48a5e0de0b6 (diff) | |
download | gcc-431cfac1ffb50746d86afbf486f84180d39c54e8.tar.gz |
utils.c (convert): When converting to a padded type with an inner type of self-referential size...
* gcc-interface/utils.c (convert): When converting to a padded type
with an inner type of self-referential size, pad the expression before
doing the unchecked conversion.
From-SVN: r152935
Diffstat (limited to 'gcc/testsuite/gnat.dg')
-rw-r--r-- | gcc/testsuite/gnat.dg/aggr11.adb | 17 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/aggr11_pkg.ads | 14 |
2 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/aggr11.adb b/gcc/testsuite/gnat.dg/aggr11.adb new file mode 100644 index 00000000000..1771d62cacb --- /dev/null +++ b/gcc/testsuite/gnat.dg/aggr11.adb @@ -0,0 +1,17 @@ +-- { dg-do compile }
+-- { dg-options "-O" }
+
+with Aggr11_Pkg; use Aggr11_Pkg;
+
+procedure Aggr11 is
+
+ A : Arr := ((1 => (Kind => No_Error, B => True),
+ 2 => (Kind => Error),
+ 3 => (Kind => Error),
+ 4 => (Kind => No_Error, B => True),
+ 5 => (Kind => No_Error, B => True),
+ 6 => (Kind => No_Error, B => True)));
+
+begin
+ null;
+end;
diff --git a/gcc/testsuite/gnat.dg/aggr11_pkg.ads b/gcc/testsuite/gnat.dg/aggr11_pkg.ads new file mode 100644 index 00000000000..37008605a30 --- /dev/null +++ b/gcc/testsuite/gnat.dg/aggr11_pkg.ads @@ -0,0 +1,14 @@ +package Aggr11_Pkg is
+
+ type Error_Type is (No_Error, Error);
+
+ type Rec (Kind : Error_Type := No_Error) is record
+ case Kind is
+ when Error => null;
+ when others => B : Boolean;
+ end case;
+ end record;
+
+ type Arr is array (1..6) of Rec;
+
+end Aggr11_Pkg;
|