aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-09-05 21:05:10 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-09-05 21:05:10 -0400
commitecfd5f25bfa7b5ce00b8feb83eb1deeb7009e7f7 (patch)
tree6f16e1a5026ba8567b811826b0de645bde82587c
parentb26e6d2c8ff71beac5da975de1b6ac450bfe282b (diff)
Add new type check files for func/proc arguments
-rw-r--r--check/args-proc.p45
-rw-r--r--check/args.p45
2 files changed, 90 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.