diff options
Diffstat (limited to 'check')
35 files changed, 283 insertions, 0 deletions
| diff --git a/check/args-proc.p b/check/args-proc.p new file mode 100644 index 0000000..d49f932 --- /dev/null +++ b/check/args-proc.p @@ -0,0 +1,45 @@ +program main ( input, output ); + +        var a, b: integer; +        var x,y,z: real; +	var ai :array [1..10] of integer; + +	procedure bar (a, b: integer); +	var test:integer; +	begin +		test := 2; +		a := 2 +	end; +	procedure bar1 (a, b: real); +	var test:integer; +	begin +		test := 2; +		a := 2.0 +	end; +	procedure bar2 (a: real); +	var test:integer; +	begin +		test := 2; +		a := 2.0 +	end; +	procedure bar3 (a, b, c, d, e, f, g: integer); +	var test:integer; +	begin +		test := 2; +		a := 2 +	end; +	procedure bar4 (a, b, c, d: real; e, f, g: integer); +	var test:integer; +	begin +		test := 2; +		a := 2.0; +		e := 2 +	end; +begin +{ TEST } + +	a := 1; +        x := 3.14; +	b := a + 35 +	(* test *) +end. diff --git a/check/args.p b/check/args.p new file mode 100644 index 0000000..358dc7c --- /dev/null +++ b/check/args.p @@ -0,0 +1,45 @@ +program main ( input, output ); + +        var a, b: integer; +        var x,y,z: real; +	var ai :array [1..10] of integer; + +	function bar (a, b: integer) : real; +	var test:integer; +	begin +		test := 2; +		a := 2 +	end; +	function bar1 (a, b: real) : real; +	var test:integer; +	begin +		test := 2; +		a := 2.0 +	end; +	function bar2 (a: real) : real; +	var test:integer; +	begin +		test := 2; +		a := 2.0 +	end; +	function bar3 (a, b, c, d, e, f, g: integer) : real; +	var test:integer; +	begin +		test := 2; +		a := 2 +	end; +	function bar4 (a, b, c, d: real; e, f, g: integer) : real; +	var test:integer; +	begin +		test := 2; +		a := 2.0; +		e := 2 +	end; +begin +{ TEST } + +	a := 1; +        x := 3.14; +	b := a + 35 +	(* test *) +end. diff --git a/check/type/addop/fail-int.p b/check/type/addop/fail-int.p new file mode 100644 index 0000000..0d75b0d --- /dev/null +++ b/check/type/addop/fail-int.p @@ -0,0 +1,4 @@ +program main ( input, output ); +begin +	1 + 1.1 +end. diff --git a/check/type/addop/fail-real.p b/check/type/addop/fail-real.p new file mode 100644 index 0000000..865f0fc --- /dev/null +++ b/check/type/addop/fail-real.p @@ -0,0 +1,5 @@ +program main ( input, output ); +        var a: integer; +begin +	a := 1.1 + 1 +end. diff --git a/check/type/addop/pass-int.p b/check/type/addop/pass-int.p new file mode 100644 index 0000000..8a65883 --- /dev/null +++ b/check/type/addop/pass-int.p @@ -0,0 +1,4 @@ +program main ( input, output ); +begin +	1 + 1 +end. diff --git a/check/type/addop/pass-real.p b/check/type/addop/pass-real.p new file mode 100644 index 0000000..7cf1450 --- /dev/null +++ b/check/type/addop/pass-real.p @@ -0,0 +1,5 @@ +program main ( input, output ); +        var a: real; +begin +	a := 3.1 + 0.04 +end. diff --git a/check/type/arrray/fail-access.p b/check/type/arrray/fail-access.p new file mode 100644 index 0000000..c77aee3 --- /dev/null +++ b/check/type/arrray/fail-access.p @@ -0,0 +1,5 @@ +program main ( input, output ); +        var a: array [1..10] of integer; +begin +	a[3.2] := 1 +end. diff --git a/check/type/arrray/fail-int.p b/check/type/arrray/fail-int.p new file mode 100644 index 0000000..672f798 --- /dev/null +++ b/check/type/arrray/fail-int.p @@ -0,0 +1,5 @@ +program main ( input, output ); +        var a: array [1..10] of integer; +begin +	a[3] := 1.1 +end. diff --git a/check/type/arrray/fail-real.p b/check/type/arrray/fail-real.p new file mode 100644 index 0000000..993dbf9 --- /dev/null +++ b/check/type/arrray/fail-real.p @@ -0,0 +1,5 @@ +program main ( input, output ); +        var a: array [1..10] of real; +begin +	a[3] := 1 +end. diff --git a/check/type/arrray/pass-access.p b/check/type/arrray/pass-access.p new file mode 100644 index 0000000..a6af0ec --- /dev/null +++ b/check/type/arrray/pass-access.p @@ -0,0 +1,5 @@ +program main ( input, output ); +        var a: array [1..10] of integer; +begin +	a[3] := 1 +end. diff --git a/check/type/arrray/pass-int.p b/check/type/arrray/pass-int.p new file mode 100644 index 0000000..a6af0ec --- /dev/null +++ b/check/type/arrray/pass-int.p @@ -0,0 +1,5 @@ +program main ( input, output ); +        var a: array [1..10] of integer; +begin +	a[3] := 1 +end. diff --git a/check/type/arrray/pass-real.p b/check/type/arrray/pass-real.p new file mode 100644 index 0000000..582bbdb --- /dev/null +++ b/check/type/arrray/pass-real.p @@ -0,0 +1,5 @@ +program main ( input, output ); +        var a: array [1..10] of real; +begin +	a[3] := 1.1 +end. diff --git a/check/type/assign/fail-int.p b/check/type/assign/fail-int.p new file mode 100644 index 0000000..d17bc1c --- /dev/null +++ b/check/type/assign/fail-int.p @@ -0,0 +1,5 @@ +program main ( input, output ); +        var a: integer; +begin +	a := 1.1 +end. diff --git a/check/type/assign/fail-real.p b/check/type/assign/fail-real.p new file mode 100644 index 0000000..47fde34 --- /dev/null +++ b/check/type/assign/fail-real.p @@ -0,0 +1,5 @@ +program main ( input, output ); +        var a: real; +begin +	a := 1 +end. diff --git a/check/type/assign/pass-int.p b/check/type/assign/pass-int.p new file mode 100644 index 0000000..5f150c8 --- /dev/null +++ b/check/type/assign/pass-int.p @@ -0,0 +1,5 @@ +program main ( input, output ); +        var a: integer; +begin +	a := 1 +end. diff --git a/check/type/assign/pass-real.p b/check/type/assign/pass-real.p new file mode 100644 index 0000000..13db838 --- /dev/null +++ b/check/type/assign/pass-real.p @@ -0,0 +1,5 @@ +program main ( input, output ); +        var a: real; +begin +	a := 1.1 +end. diff --git a/check/type/bool/.pass-bool.c.swp b/check/type/bool/.pass-bool.c.swpBinary files differ new file mode 100644 index 0000000..e18746d --- /dev/null +++ b/check/type/bool/.pass-bool.c.swp diff --git a/check/type/bool/fail-and.p b/check/type/bool/fail-and.p new file mode 100644 index 0000000..124de1f --- /dev/null +++ b/check/type/bool/fail-and.p @@ -0,0 +1,7 @@ + +program main ( input, output ); +        var a: integer; +begin +	a := 1; +        (a = 1) and 1 +end. diff --git a/check/type/bool/fail-bool.p b/check/type/bool/fail-bool.p new file mode 100644 index 0000000..4cf0b6e --- /dev/null +++ b/check/type/bool/fail-bool.p @@ -0,0 +1,5 @@ +program main ( input, output ); +        var a: integer; +begin +	not 1.1 +end. diff --git a/check/type/bool/fail-if.p b/check/type/bool/fail-if.p new file mode 100644 index 0000000..17126d6 --- /dev/null +++ b/check/type/bool/fail-if.p @@ -0,0 +1,9 @@ +program main ( input, output ); +        var a: integer; +begin +	if (1) +        then +                a:= 1 +        else +                a:= 0 +end. diff --git a/check/type/bool/fail-int.p b/check/type/bool/fail-int.p new file mode 100644 index 0000000..3eb4866 --- /dev/null +++ b/check/type/bool/fail-int.p @@ -0,0 +1,5 @@ +program main ( input, output ); +        var a: integer; +begin +	1 <> 1.1 +end. diff --git a/check/type/bool/fail-or.p b/check/type/bool/fail-or.p new file mode 100644 index 0000000..a48cdf3 --- /dev/null +++ b/check/type/bool/fail-or.p @@ -0,0 +1,6 @@ +program main ( input, output ); +        var a: integer; +begin +	a := 1; +        (a = 1) or 1.1 +end. diff --git a/check/type/bool/fail-real.p b/check/type/bool/fail-real.p new file mode 100644 index 0000000..7c7d00d --- /dev/null +++ b/check/type/bool/fail-real.p @@ -0,0 +1,4 @@ +program main ( input, output ); +begin +	1.1 <> 1 +end. diff --git a/check/type/bool/fail-while.p b/check/type/bool/fail-while.p new file mode 100644 index 0000000..b02048d --- /dev/null +++ b/check/type/bool/fail-while.p @@ -0,0 +1,7 @@ +program main ( input, output ); +        var a: integer; +begin +	while (1) +        do +                a:= 0 +end. diff --git a/check/type/bool/pass-bool.p b/check/type/bool/pass-bool.p new file mode 100644 index 0000000..3701bcb --- /dev/null +++ b/check/type/bool/pass-bool.p @@ -0,0 +1,7 @@ +program main ( input, output ); +        var a: integer; +begin +	not (1.1 = 1.1); +	(1.1 = 1.1) or (1 = 2); +	(1.1 = 1.1) and (1 = 2) +end. diff --git a/check/type/bool/pass-if.p b/check/type/bool/pass-if.p new file mode 100644 index 0000000..30e5abf --- /dev/null +++ b/check/type/bool/pass-if.p @@ -0,0 +1,9 @@ +program main ( input, output ); +        var a: integer; +begin +	if ((1 = 1) ) +        then +                a:= 1 +        else +                a:= 0 +end. diff --git a/check/type/bool/pass-int.p b/check/type/bool/pass-int.p new file mode 100644 index 0000000..da2bc97 --- /dev/null +++ b/check/type/bool/pass-int.p @@ -0,0 +1,10 @@ +program main ( input, output ); +        var a: integer; +begin +	1 = 1; +	1 <= 1; +	1 >= 1; +	1 < 1; +	1 > 1; +	1 <> 1 +end. diff --git a/check/type/bool/pass-real.p b/check/type/bool/pass-real.p new file mode 100644 index 0000000..67e8b99 --- /dev/null +++ b/check/type/bool/pass-real.p @@ -0,0 +1,10 @@ +program main ( input, output ); +        var a: integer; +begin +	1.1 = 1.1; +	1.1 <= 1.1; +	1.1 >= 1.1; +	1.1 < 1.1; +	1.1 > 1.1; +	1.1 <> 1.1 +end. diff --git a/check/type/bool/pass-while.p b/check/type/bool/pass-while.p new file mode 100644 index 0000000..160c187 --- /dev/null +++ b/check/type/bool/pass-while.p @@ -0,0 +1,7 @@ +program main ( input, output ); +        var a: integer; +begin +	while ((1 = 1) ) +        do +                a:= 1 +end. diff --git a/check/type/fail-if.p b/check/type/fail-if.p new file mode 100644 index 0000000..17126d6 --- /dev/null +++ b/check/type/fail-if.p @@ -0,0 +1,9 @@ +program main ( input, output ); +        var a: integer; +begin +	if (1) +        then +                a:= 1 +        else +                a:= 0 +end. diff --git a/check/type/mulop/fail-int.p b/check/type/mulop/fail-int.p new file mode 100644 index 0000000..fdd83e3 --- /dev/null +++ b/check/type/mulop/fail-int.p @@ -0,0 +1,6 @@ +program main ( input, output ); +        var a: integer; +begin +	a := 1 * 1.1; +	a := 1.1 +end. diff --git a/check/type/mulop/fail-real.p b/check/type/mulop/fail-real.p new file mode 100644 index 0000000..8975458 --- /dev/null +++ b/check/type/mulop/fail-real.p @@ -0,0 +1,5 @@ +program main ( input, output ); +        var a: integer; +begin +	a := 1.1 * 1 +end. diff --git a/check/type/mulop/pass-int.p b/check/type/mulop/pass-int.p new file mode 100644 index 0000000..5f1f327 --- /dev/null +++ b/check/type/mulop/pass-int.p @@ -0,0 +1,5 @@ +program main ( input, output ); +        var a: integer; +begin +	a := 1 * 1 +end. diff --git a/check/type/mulop/pass-real.p b/check/type/mulop/pass-real.p new file mode 100644 index 0000000..d03ee76 --- /dev/null +++ b/check/type/mulop/pass-real.p @@ -0,0 +1,5 @@ +program main ( input, output ); +        var a: real; +begin +	a := 3.1 * 0.04 +end. diff --git a/check/type/pass-if.p b/check/type/pass-if.p new file mode 100644 index 0000000..30e5abf --- /dev/null +++ b/check/type/pass-if.p @@ -0,0 +1,9 @@ +program main ( input, output ); +        var a: integer; +begin +	if ((1 = 1) ) +        then +                a:= 1 +        else +                a:= 0 +end. | 
