From c23c575f73b133bd552ea30461c05f70b5264866 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Mon, 11 Feb 2008 14:40:28 +0000 Subject: [PATCH] Added some more testcases for array usage checking that involve complicated expressions --- testcases/automatic/usage-check-1.occ.test | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/testcases/automatic/usage-check-1.occ.test b/testcases/automatic/usage-check-1.occ.test index 61571f8..b10ba8f 100644 --- a/testcases/automatic/usage-check-1.occ.test +++ b/testcases/automatic/usage-check-1.occ.test @@ -143,4 +143,34 @@ PROC m() x := 2 y := 3 +%PASS PAR with unuseable (but safe) division #1 + a[x / y] := 3 + a[(x / y) + 1] := 3 + +%PASS PAR with unuseable (but safe) division #2 + a[x / (y * z)] := 3 + a[(x / (z * y)) + 1] := 3 + +%PASS PAR with confusing multiplied indices #1 + a[x * y] := 3 + a[(y * x) + 1] := 3 + +%PASS PAR with confusing multiplied indices #2 + a[(x * y) * z] := 3 + a[((y * z) * x) + 1] := 3 + a[(y * (z * x)) + 2] := 3 + a[((x * z) * y) + 3] := 3 + +%PASS PAR with confusing multiplied indices #3 + a[(x * y) / 3] := 3 + a[((y * x) / 3) + 1] := 3 + +%PASS PAR with confusing multiplied indices #4 + a[x*(x+y)] := 3 + a[((x*x) + (x*y)) + 1] := 3 + +%PASS PAR with confusing multiplied indices #5 + a[(x REM z)*(x+y)] := 3 + a[(((x REM z)*x) + ((x REM z)*y)) + 1] := 3 + %