diff options
Diffstat (limited to 'check')
-rw-r--r-- | check/base.p | 4 | ||||
-rw-r--r-- | check/code-gen/assign.p | 6 | ||||
-rw-r--r-- | check/code-gen/assign2.p | 14 | ||||
-rw-r--r-- | check/code-gen/ifs.p | 37 | ||||
-rw-r--r-- | check/code-gen/proc.p | 22 | ||||
-rw-r--r-- | check/code-gen/write.p | 4 | ||||
-rw-r--r-- | check/main.p | 14 | ||||
-rw-r--r-- | check/ops_list.p | 7 | ||||
-rw-r--r-- | check/recurs-proc.p | 10 | ||||
-rw-r--r-- | check/recurs.p | 12 |
10 files changed, 125 insertions, 5 deletions
diff --git a/check/base.p b/check/base.p new file mode 100644 index 0000000..2a3414f --- /dev/null +++ b/check/base.p @@ -0,0 +1,4 @@ +program main ( output); +begin +write(1) +end. diff --git a/check/code-gen/assign.p b/check/code-gen/assign.p new file mode 100644 index 0000000..f8473f0 --- /dev/null +++ b/check/code-gen/assign.p @@ -0,0 +1,6 @@ +program main (output); + var a,b,c,d,e: integer; +begin + a := 1; + write(a) +end. diff --git a/check/code-gen/assign2.p b/check/code-gen/assign2.p new file mode 100644 index 0000000..7d94abc --- /dev/null +++ b/check/code-gen/assign2.p @@ -0,0 +1,14 @@ +program main (output); + var a,b,c,d,e: integer; +begin + a := 1; + b := 2; + c := 3; + d := 4; + e := 5; + write(a); + write(b); + write(c); + write(d); + write(e) +end. diff --git a/check/code-gen/ifs.p b/check/code-gen/ifs.p new file mode 100644 index 0000000..533eadc --- /dev/null +++ b/check/code-gen/ifs.p @@ -0,0 +1,37 @@ +program main (); + var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o: integer; + var rb,rc,rd,re,rf,rg,rh,ri,rj,rk,rl,rm,rn,ro: real; +begin + a := 0; + if ( 1 = 2 ) then b:= 1; + if ( 1.1 = 2.1 ) then c:=0; + b := 1; + c := 1; + d := 1; + e := 1; + f := 1; + g := 1; + h := 1; + i := 1; + j := 1; + k := 1; + l := 1; + m := 1; + n := 1; + o := 1; + + rb := 1.0; + rc := 1.0; + rd := 1.0; + re := 1.0; + rf := 1.0; + rg := 1.0; + rh := 1.0; + ri := 1.0; + rj := 1.0; + rk := 1.0; + rl := 1.0; + rm := 1.0; + rn := 1.0; + ro := 1.0 +end. diff --git a/check/code-gen/proc.p b/check/code-gen/proc.p new file mode 100644 index 0000000..6d43ebf --- /dev/null +++ b/check/code-gen/proc.p @@ -0,0 +1,22 @@ +program main (output); + procedure bar (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o: integer); + begin + write(a); + write(b); + write(c); + write(d); + write(e); + write(f); + write(g); + write(h); + write(i); + write(j); + write(k); + write(l); + write(m); + write(n); + write(o) + end; +begin + bar(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) +end. diff --git a/check/code-gen/write.p b/check/code-gen/write.p new file mode 100644 index 0000000..2201bc4 --- /dev/null +++ b/check/code-gen/write.p @@ -0,0 +1,4 @@ +program main (output); +begin + write(1) +end. diff --git a/check/main.p b/check/main.p index e9c7441..777c9da 100644 --- a/check/main.p +++ b/check/main.p @@ -12,7 +12,8 @@ program main ( input, output ); var test:integer; begin test := 2; - a := 2 + a := 2; + bar := 2.1 end; procedure foo; begin @@ -23,11 +24,14 @@ program main ( input, output ); end; function order (a, b, c: integer) : real; begin - a := 2 + a := 2; + order := 2.1 + end; - function order2 (a, b, c, d, e: integer) : real; + function order2 (a, b, c, d, e: integer; f, g, h, i,j :real) : real; begin - a := 2 + a := 2; + order2 := 2.1 end; begin { TEST } @@ -35,7 +39,7 @@ begin a := 1; x := 3.14; x := order(a, b, c); - x := order2(a, b, c, d, e); + x := order2(a, b, c, d, e, 1.0, 1.0, 1.0, 1.0, 1.0); x := bar(a); foo; boo(a); diff --git a/check/ops_list.p b/check/ops_list.p new file mode 100644 index 0000000..9841194 --- /dev/null +++ b/check/ops_list.p @@ -0,0 +1,7 @@ + +program main ( input, output ); + var a: integer; +begin +{ TEST } + a := 1 + 2 + 3 - 4 * 5 / 6 +end. diff --git a/check/recurs-proc.p b/check/recurs-proc.p new file mode 100644 index 0000000..53c300b --- /dev/null +++ b/check/recurs-proc.p @@ -0,0 +1,10 @@ +program main ( input, output ); + var a: integer; + procedure bar (b: integer); + var test:integer; + begin + bar := bar(test) + end; +begin + bar(1) +end. diff --git a/check/recurs.p b/check/recurs.p new file mode 100644 index 0000000..e85acbc --- /dev/null +++ b/check/recurs.p @@ -0,0 +1,12 @@ +program main ( input, output ); + var a: integer; + function bar (b: integer) : integer; + var test:integer; + begin + test := bar(test); + bar := test + end; +begin + a := bar(1); + a := 1 + 1 +end. |