summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/g77_intrinsics_sub.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_intrinsics_sub.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_intrinsics_sub.f')
-rw-r--r--gcc/testsuite/gfortran.dg/g77_intrinsics_sub.f84
1 files changed, 84 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/g77_intrinsics_sub.f b/gcc/testsuite/gfortran.dg/g77_intrinsics_sub.f
new file mode 100644
index 000000000..6ee5f837c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/g77_intrinsics_sub.f
@@ -0,0 +1,84 @@
+! { dg-do compile }
+! { dg-options "-std=legacy" }
+!
+! Testing g77 intrinsics as subroutines
+ integer(kind=8) i8, j8
+ integer i4, j4
+ integer i, j
+ character*80 c
+
+ call gerror (c)
+ call getlog (c)
+
+ call hostnm (c, status = i8)
+ call hostnm (c, i8)
+ call hostnm (c, status = i4)
+ call hostnm (c, i4)
+ call hostnm (c, status = i)
+ call hostnm (c, i)
+ call hostnm (c)
+
+ call kill (i8, i8, status = i8)
+ call kill (i8, i8, i8)
+ call kill (i4, i8, i8)
+ call kill (i8, i4, i8)
+ call kill (i8, i8, i4)
+ call kill (i4, i4, i8)
+ call kill (i4, i8, i4)
+ call kill (i8, i4, i4)
+ call kill (i4, i4, i4)
+ call kill (i, i, i)
+ call kill (i8, i8)
+ call kill (i4, i8)
+ call kill (i8, i4)
+ call kill (i4, i4)
+ call kill (i, i)
+
+ call link ('foo', 'bar', status = i8)
+ call link ('foo', 'bar', status = i4)
+ call link ('foo', 'bar', status = i)
+ call link ('foo', 'bar', i8)
+ call link ('foo', 'bar', i4)
+ call link ('foo', 'bar', i)
+ call link ('foo', 'bar')
+
+ call perror (c)
+
+ call rename ('foo', 'bar', status = i8)
+ call rename ('foo', 'bar', status = i4)
+ call rename ('foo', 'bar', status = i)
+ call rename ('foo', 'bar', i8)
+ call rename ('foo', 'bar', i4)
+ call rename ('foo', 'bar', i)
+ call rename ('foo', 'bar')
+
+ i = 1
+ i4 = 1
+ i8 = 1
+ call sleep (i)
+ call sleep (i4)
+ call sleep (i8)
+ call sleep (-1)
+
+ call symlnk ('foo', 'bar', status = i8)
+ call symlnk ('foo', 'bar', status = i4)
+ call symlnk ('foo', 'bar', status = i)
+ call symlnk ('foo', 'bar', i8)
+ call symlnk ('foo', 'bar', i4)
+ call symlnk ('foo', 'bar', i)
+ call symlnk ('foo', 'bar')
+
+! Cleaning our mess
+ call unlink ('bar')
+
+! This should be the last test, unless you want garbage everywhere in
+! your filesystem.
+ call chdir ('..', status = i8)
+ call chdir ('..', i8)
+ call chdir ('..', status = i4)
+ call chdir ('..', i4)
+ call chdir ('..', status = i)
+ call chdir ('..', i)
+ call chdir ('..')
+
+ end