From 12ab99c627e7744a8161072d20fd887ac4f38ef7 Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Tue, 16 Apr 1991 21:59:06 -0800 Subject: [PATCH] date and time created 91/04/16 14:59:06 by bostic SCCS-vsn: usr.bin/pascal/pdx/test/test.p 5.1 --- usr/src/usr.bin/pascal/pdx/test/test.p | 68 ++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 usr/src/usr.bin/pascal/pdx/test/test.p diff --git a/usr/src/usr.bin/pascal/pdx/test/test.p b/usr/src/usr.bin/pascal/pdx/test/test.p new file mode 100644 index 0000000000..20dbfb66fb --- /dev/null +++ b/usr/src/usr.bin/pascal/pdx/test/test.p @@ -0,0 +1,68 @@ +(* + * Copyright (c) 1980 The Regents of the University of California. + * All rights reserved. + * + * %sccs.include.redist.c% + * + * @(#)test.p 5.1 (Berkeley) %G% + *) + +program blah(input, output); +const + CONSTANT = 3; + FLTCON = 3.14; +type + Index = 1..10; + intarray = array[Index] of 0..100; + rec = record + x : integer; + y : char; + z : integer; + end; +var + i : integer; + x : real; + a : array[1..10] of intarray; + r : rec; + p : ^rec; + b : boolean; + unused : integer; + +function first(var p : integer) : integer; +begin + i := p; + r.x := 4; + r.y := 'y'; + r.z := 6; + b := true; + first := p; +end; + +procedure start; +var q : integer; +begin + q := -5; + q := first(q); + a[i][1] := q; +end; + +procedure init; +var i, j : integer; +begin + b := false; + for i := 1 to 10 do begin + for j := 1 to 10 do begin + a[i][j] := 10*(i-1) + j; + end; + end; + start; +end; + +begin + init; + a[1][1] := 3; + a[10][1] := 2; + a[1][10] := 1; + writeln('garbage'); + readln(i); +end. -- 2.20.1