gcc/testsuite/gm2/isolib/run/pass/testrestline2.mod
raw| 1 | MODULE testrestline2 ; |
| 2 | |
| 3 | IMPORT SeqFile, TextIO ; |
| 4 | |
| 5 | VAR |
| 6 | chan : SeqFile.ChanId ; |
| 7 | line : ARRAY [0..5] OF CHAR ; |
| 8 | results : SeqFile.OpenResults ; |
| 9 | BEGIN |
| 10 | SeqFile.OpenWrite (chan, "test.input", SeqFile.write, results) ; |
| 11 | TextIO.WriteString (chan, "a line of text exceeding 6 chars") ; |
| 12 | TextIO.WriteLn (chan) ; |
| 13 | |
| 14 | (* Now see if we can read the first line. *) |
| 15 | SeqFile.OpenRead (chan, "test.input", SeqFile.read, results) ; |
| 16 | TextIO.ReadRestLine (chan, line) |
| 17 | END testrestline2. |