summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/opt63.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gnat.dg/opt63.adb')
-rw-r--r--gcc/testsuite/gnat.dg/opt63.adb19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/opt63.adb b/gcc/testsuite/gnat.dg/opt63.adb
new file mode 100644
index 00000000000..6471be40bbd
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt63.adb
@@ -0,0 +1,19 @@
+-- { dg-do compile }
+-- { dg-options "-O -gnatws" }
+
+procedure Opt63 is
+
+ type T_MOD is mod 2**32;
+ subtype T_INDEX is T_MOD range 3_000_000_000 .. 4_000_000_000;
+ type T_ARRAY is array(T_INDEX range <>) of INTEGER;
+
+ function Build_Crash(First : T_INDEX; Length : NATURAL) return T_ARRAY is
+ R : T_ARRAY(First .. T_Index'Val (T_Index'Pos (First) + Length))
+ := (others => -1); -- Crash here
+ begin
+ return R;
+ end;
+
+begin
+ null;
+end;