diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2015-11-30 11:34:31 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2015-11-30 11:34:31 +0000 |
commit | f8125f0c9ce43aac6d7a96753e4617af68ee0009 (patch) | |
tree | c9fd197ea12537544785bc54773f93d385651a75 /gcc/testsuite/gnat.dg | |
parent | 14ecca2eea820447afe3214ed635883fbc4244a4 (diff) | |
download | gcc-f8125f0c9ce43aac6d7a96753e4617af68ee0009.zip gcc-f8125f0c9ce43aac6d7a96753e4617af68ee0009.tar.gz gcc-f8125f0c9ce43aac6d7a96753e4617af68ee0009.tar.bz2 |
* gcc-interface/utils2.c (gnat_invariant_expr): Add type conversions.
From-SVN: r231063
Diffstat (limited to 'gcc/testsuite/gnat.dg')
-rw-r--r-- | gcc/testsuite/gnat.dg/loop_optimization22.adb | 16 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/loop_optimization22.ads | 7 |
2 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/loop_optimization22.adb b/gcc/testsuite/gnat.dg/loop_optimization22.adb new file mode 100644 index 0000000..7fb307b --- /dev/null +++ b/gcc/testsuite/gnat.dg/loop_optimization22.adb @@ -0,0 +1,16 @@ +-- { dg-do compile } +-- { dg-options "-O" } + +pragma Overflow_Mode (Minimized); + +package body Loop_Optimization22 is + + procedure Foo (X : Discrim_Type) is + H : array (1 .. Integer (X.Count) + 1) of Float; + begin + for I in 1 .. X.Count loop + H (Integer(I) + 1):= 0.0; + end loop; + end; + +end Loop_Optimization22; diff --git a/gcc/testsuite/gnat.dg/loop_optimization22.ads b/gcc/testsuite/gnat.dg/loop_optimization22.ads new file mode 100644 index 0000000..ec3ac0d --- /dev/null +++ b/gcc/testsuite/gnat.dg/loop_optimization22.ads @@ -0,0 +1,7 @@ +package Loop_Optimization22 is + + type Discrim_Type (Count : Positive) is null record; + + procedure Foo (X : Discrim_Type); + +end Loop_Optimization22; |