Add some testcases for usage-checking on user-defined array types.

These were based on KRoC bug #194, submitted by Jonathan May.
This commit is contained in:
Adam Sampson 2009-03-21 15:37:56 +00:00
parent deedad4268
commit 77be0c1137
2 changed files with 41 additions and 0 deletions

View File

@ -1183,6 +1183,7 @@ vioqcTests v
,"testcases/automatic/usage-check-7.occ.test"
,"testcases/automatic/usage-check-8.occ.test"
,"testcases/automatic/usage-check-9.occ.test"
,"testcases/automatic/usage-check-10.occ.test"
]
,return $ qcOmegaEquality ++ qcOmegaPrune ++ qcTestMakeEquations)

View File

@ -0,0 +1,40 @@
-- This file tests array usage checking on user data types.
VAL INT MAX IS 32 :
DATA TYPE COLUMN IS [MAX]REAL32:
DATA TYPE MATRIX IS [MAX]COLUMN:
PROC p ()
MATRIX m:
COLUMN c:
%%
:
PROC main ()
p ()
:
%PASS User-defined array
PAR i = 0 FOR MAX
c[i] := 42.0
%PASS User-defined array, SEQ in PAR
PAR
m[0][0] := 24.0
SEQ i = 0 FOR MAX
c[i] := 42.0
%PASS User-defined array of user-defined arrays
PAR i = 0 FOR MAX
PAR j = 0 FOR MAX
m[i][j] := 42.0
%PASS User-defined array of user-defined arrays, SEQ in PAR
CHAN OF COLUMN c:
COLUMN x:
PAR
SEQ i = 0 FOR MAX
c ! m[i]
c ? x
%