public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Testcase for PR48329
@ 2014-04-30 11:56 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2014-04-30 11:56 UTC (permalink / raw)
  To: gcc-patches


Committed.

Richard.

2014-04-30  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/48329
	* gfortran.dg/vect/pr48329.f90: New testcase.

Index: gcc/testsuite/gfortran.dg/vect/pr48329.f90
===================================================================
--- gcc/testsuite/gfortran.dg/vect/pr48329.f90	(revision 0)
+++ gcc/testsuite/gfortran.dg/vect/pr48329.f90	(working copy)
@@ -0,0 +1,29 @@
+! { dg-do compile }
+! { dg-require-effective-target vect_float }
+! { dg-require-effective-target vect_intfloat_cvt }
+! { dg-additional-options "-ffast-math" }
+
+program calcpi
+
+    implicit none
+    real(kind=4):: h,x,sum,pi
+    integer:: n,i
+    real(kind=4):: f
+
+   f(x) = 4.0/(1.0+x**2)
+
+   n = 2100000000
+
+   h= 1.0 / n
+   sum = 0.0
+  DO i=1, n
+     x = h * (i-0.5)
+     sum = sum + f(x)
+  END DO
+  pi = h * sum
+  write(*,*) 'Pi=',pi
+
+end program calcpi
+
+! { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } }
+! { dg-final { cleanup-tree-dump "vect" } }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-04-30 11:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-30 11:56 [PATCH] Testcase for PR48329 Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).