summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorfx <fx@138bc75d-0d04-0410-961f-82ee72b054a4>1998-07-25 04:33:22 +0000
committerfx <fx@138bc75d-0d04-0410-961f-82ee72b054a4>1998-07-25 04:33:22 +0000
commitb7155f55f06bf534c6db8f41de442c2557d944fa (patch)
tree4520933f2d9dfb1f4a2e7caaf8c7e5fdeea84b5b /gcc
parent9ffdedcf0a4c1761bc56b82708d13d087897d766 (diff)
downloadgcc-b7155f55f06bf534c6db8f41de442c2557d944fa.tar.gz
New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@21371 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g77.f-torture/execute/io0.f38
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc/testsuite/g77.f-torture/execute/io0.f b/gcc/testsuite/g77.f-torture/execute/io0.f
new file mode 100644
index 00000000000..d85d3370959
--- /dev/null
+++ b/gcc/testsuite/g77.f-torture/execute/io0.f
@@ -0,0 +1,38 @@
+* Preliminary tests for a few things in the i/o library.
+* Thrown together by Dave Love not from specific bug reports --
+* other ideas welcome.
+
+ character *(*) fmt
+ parameter (fmt='(1x,i3,f5.1)')
+* Scratch file makes sure we can use one and avoids dealing with
+* explicit i/o in the testsuite.
+ open(90, status='scratch') ! try a biggish unit number
+ write(90, '()') ! extra record for interest
+* Formatted i/o can go wild (endless loop AFAIR) if we're wrongly
+* assuming an ANSI sprintf.
+ write(90, fmt) 123, 123.0
+ backspace 90 ! backspace problems reported on DOSish systems
+ read(90, fmt) i, r
+ endfile 90
+ if (i/=123 .or. nint(r)/=123) call abort
+ rewind 90 ! make sure we can rewind too
+ read(90, '()')
+ read(90, fmt) i, r
+ if (i/=123 .or. nint(r)/=123) call abort
+ close(90)
+* Make sure we can do unformatted i/o OK. This might be
+* problematic on DOS-like systems if we've done an fopen in text
+* mode, not binary.
+ open(90, status='scratch', access='direct', form='unformatted',
+ + recl=8)
+ write(90, rec=1) 123, 123.0
+ read(90, rec=1) i, r
+ if (i/=123 .or. nint(r)/=123) call abort
+ close(90)
+ open(90, status='scratch', form='unformatted')
+ write(90) 123, 123.0
+ backspace 90
+ read(90) i, r
+ if (i/=123 .or. nint(r)/=123) call abort
+ close(90)
+ end