summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/g77/short.f
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gfortran.dg/g77/short.f
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gfortran.dg/g77/short.f')
-rw-r--r--gcc/testsuite/gfortran.dg/g77/short.f60
1 files changed, 60 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/g77/short.f b/gcc/testsuite/gfortran.dg/g77/short.f
new file mode 100644
index 000000000..330f0ac52
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/g77/short.f
@@ -0,0 +1,60 @@
+c { dg-do run }
+c { dg-options "-std=legacy" }
+c
+ program short
+
+ parameter ( N=2 )
+ common /chb/ pi,sig(0:N)
+ common /parm/ h(2,2)
+
+c initialize some variables
+ h(2,2) = 1117
+ h(2,1) = 1178
+ h(1,2) = 1568
+ h(1,1) = 1621
+ sig(0) = -1.
+ sig(1) = 0.
+ sig(2) = 1.
+
+ call printout
+ stop
+ end
+
+c ******************************************************************
+
+ subroutine printout
+ parameter ( N=2 )
+ common /chb/ pi,sig(0:N)
+ common /parm/ h(2,2)
+ dimension yzin1(0:N), yzin2(0:N)
+
+c function subprograms
+ z(i,j,k) = 0.5*h(i,j)*(sig(k)-1.)
+
+c a four-way average of rhobar
+ do 260 k=0,N
+ yzin1(k) = 0.25 *
+ & ( z(2,2,k) + z(1,2,k) +
+ & z(2,1,k) + z(1,1,k) )
+ 260 continue
+
+c another four-way average of rhobar
+ do 270 k=0,N
+ rtmp1 = z(2,2,k)
+ rtmp2 = z(1,2,k)
+ rtmp3 = z(2,1,k)
+ rtmp4 = z(1,1,k)
+ yzin2(k) = 0.25 *
+ & ( rtmp1 + rtmp2 + rtmp3 + rtmp4 )
+ 270 continue
+
+ do k=0,N
+ if (yzin1(k) .ne. yzin2(k)) call abort
+ enddo
+ if (yzin1(0) .ne. -1371.) call abort
+ if (yzin1(1) .ne. -685.5) call abort
+ if (yzin1(2) .ne. 0.) call abort
+
+ return
+ end
+