diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2009-10-17 11:05:35 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2009-10-17 11:05:35 +0000 |
commit | 3f273c8a53e786389658f14a0316e48a5e0de0b6 (patch) | |
tree | fd8d2040380c07dc46f6c8584fa8fb12829b0e61 /gcc/testsuite/gnat.dg | |
parent | 7fc6a96bed6d0b2511f56e246c5ca0c3058616aa (diff) | |
download | gcc-3f273c8a53e786389658f14a0316e48a5e0de0b6.tar.gz |
utils2.c (build_binary_op): Make sure the element type is consistent.
* gcc-interface/utils2.c (build_binary_op) <ARRAY_RANGE_REF>: Make
sure the element type is consistent.
From-SVN: r152934
Diffstat (limited to 'gcc/testsuite/gnat.dg')
-rw-r--r-- | gcc/testsuite/gnat.dg/slice8.adb | 13 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/slice8_pkg1.ads | 3 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/slice8_pkg2.ads | 23 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/slice8_pkg3.adb | 17 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/slice8_pkg3.ads | 11 |
5 files changed, 67 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/slice8.adb b/gcc/testsuite/gnat.dg/slice8.adb new file mode 100644 index 00000000000..b05829d0f7b --- /dev/null +++ b/gcc/testsuite/gnat.dg/slice8.adb @@ -0,0 +1,13 @@ +-- { dg-do compile } +-- { dg-options "-gnatws" } + +with Slice8_Pkg1; +with Slice8_Pkg3; + +procedure Slice8 is + + package Bp is new Slice8_Pkg3 (Slice8_Pkg1); + +begin + null; +end; diff --git a/gcc/testsuite/gnat.dg/slice8_pkg1.ads b/gcc/testsuite/gnat.dg/slice8_pkg1.ads new file mode 100644 index 00000000000..3f433fdfb26 --- /dev/null +++ b/gcc/testsuite/gnat.dg/slice8_pkg1.ads @@ -0,0 +1,3 @@ +with Slice8_Pkg2; + +package Slice8_Pkg1 is new Slice8_Pkg2 (Line_Length => 132, Max_Lines => 1000); diff --git a/gcc/testsuite/gnat.dg/slice8_pkg2.ads b/gcc/testsuite/gnat.dg/slice8_pkg2.ads new file mode 100644 index 00000000000..a6eafc6aa18 --- /dev/null +++ b/gcc/testsuite/gnat.dg/slice8_pkg2.ads @@ -0,0 +1,23 @@ +generic + + Line_Length : Natural; + Max_Lines : Natural; + +package Slice8_Pkg2 is + + Subtype Index is Natural Range 0..Line_length; + Subtype Line_Count is Natural Range 0..Max_Lines; + + Type Line (Size : Index := 0) is + Record + Data : String (1..Size); + End Record; + + Type Lines is Array (Line_Count Range <>) of Line; + + Type Paragraph (Size : Line_Count) is + Record + Data : Lines (1..Size); + End Record; + +end Slice8_Pkg2; diff --git a/gcc/testsuite/gnat.dg/slice8_pkg3.adb b/gcc/testsuite/gnat.dg/slice8_pkg3.adb new file mode 100644 index 00000000000..3524de1f0f5 --- /dev/null +++ b/gcc/testsuite/gnat.dg/slice8_pkg3.adb @@ -0,0 +1,17 @@ +-- { dg-do compile } +-- { dg-options "-gnatws" } + +package body Slice8_Pkg3 is + + Current : Str.Lines (Str.Line_Count); + Last : Natural := 0; + + function Get return Str.Paragraph is + Result : constant Str.Paragraph := (Size => Last, + Data => Current (1..Last)); + begin + Last := 0; + return Result; + end Get; + +end Slice8_Pkg3; diff --git a/gcc/testsuite/gnat.dg/slice8_pkg3.ads b/gcc/testsuite/gnat.dg/slice8_pkg3.ads new file mode 100644 index 00000000000..a802cb72d9b --- /dev/null +++ b/gcc/testsuite/gnat.dg/slice8_pkg3.ads @@ -0,0 +1,11 @@ +with Slice8_Pkg2; + +generic + + with package Str is new Slice8_Pkg2 (<>); + +package Slice8_Pkg3 is + + function Get return Str.Paragraph; + +end Slice8_Pkg3; |