aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/extract_recip_1.f
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/extract_recip_1.f')
-rw-r--r--gcc/testsuite/gfortran.dg/extract_recip_1.f19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/extract_recip_1.f b/gcc/testsuite/gfortran.dg/extract_recip_1.f
new file mode 100644
index 00000000000..f70157c6da2
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/extract_recip_1.f
@@ -0,0 +1,19 @@
+! { dg-do compile }
+! { dg-options "-Ofast -fdump-tree-optimized-raw" }
+
+ SUBROUTINE F(N,X,Y,Z,A,B)
+ DIMENSION X(4,4), Y(4), Z(4)
+ REAL, INTENT(INOUT) :: A, B
+
+ A = 1 / (Y(N)*Y(N))
+
+ DO I = 1, NV
+ X(I, I) = 1 + X(I, I)
+ ENDDO
+
+ Z(1) = B / Y(N)
+ Z(2) = N / Y(N)
+ RETURN
+ END
+
+! { dg-final { scan-tree-dump-times "rdiv_expr" 1 "optimized" } }