From 3012e0ab0b1e995618bbc76ea743e2f6b37616d8 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Fri, 31 Oct 2014 12:18:30 +0000 Subject: [PATCH] * gnat.dg/opt42.ad[sb]: New test. From-SVN: r216972 --- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gnat.dg/opt42.adb | 22 ++++++++++++++++++++++ gcc/testsuite/gnat.dg/opt42.ads | 9 +++++++++ 3 files changed, 35 insertions(+) create mode 100644 gcc/testsuite/gnat.dg/opt42.adb create mode 100644 gcc/testsuite/gnat.dg/opt42.ads diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index adc0e3e366d..e0d174d4978 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2014-10-31 Eric Botcazou + + * gnat.dg/opt42.ad[sb]: New test. + 2014-10-31 Thomas Preud'homme PR tree-optimization/63259 diff --git a/gcc/testsuite/gnat.dg/opt42.adb b/gcc/testsuite/gnat.dg/opt42.adb new file mode 100644 index 00000000000..620f61a5b96 --- /dev/null +++ b/gcc/testsuite/gnat.dg/opt42.adb @@ -0,0 +1,22 @@ +-- { dg-do compile } +-- { dg-options "-cargs --param max-completely-peeled-insns=200 -margs -O3" } + +package body Opt42 is + + function "*" (Left, Right : in Array_Type) return Array_Type is + Temp : Float; + Result : Array_Type; + begin + for I in Index_Type loop + for J in Index_Type loop + Temp := 0.0; + for K in Index_Type loop + Temp := Temp + Left (I) (K) * Right (K) (J); + end loop; + Result (I) (J) := Temp; + end loop; + end loop; + return Result; + end "*"; + +end Opt42; diff --git a/gcc/testsuite/gnat.dg/opt42.ads b/gcc/testsuite/gnat.dg/opt42.ads new file mode 100644 index 00000000000..3d6a3c14a86 --- /dev/null +++ b/gcc/testsuite/gnat.dg/opt42.ads @@ -0,0 +1,9 @@ +package Opt42 is + + type Index_Type is range 1 .. 7; + type Row_Type is array (Index_Type) of Float; + type Array_Type is array (Index_Type) of Row_Type; + + function "*" (Left, Right : in Array_Type) return Array_Type; + +end Opt42; -- 2.30.2