From b3216c4870fbbcee6857233cd279eafdcfecf9fc Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Wed, 16 Jan 2008 03:28:26 +0000 Subject: [PATCH] Added a test-source-file for testing the array usage checker, and added it to the appropriate test list --- testcases/automatic/usage-check-1.occ.test | 29 ++++++++++++++++++++++ transformations/ArrayUsageCheckTest.hs | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 testcases/automatic/usage-check-1.occ.test diff --git a/testcases/automatic/usage-check-1.occ.test b/testcases/automatic/usage-check-1.occ.test new file mode 100644 index 0000000..8ad05e0 --- /dev/null +++ b/testcases/automatic/usage-check-1.occ.test @@ -0,0 +1,29 @@ +-- This file tests simple array uses without replication +-- Four unknown variables are available; x, y, z. +-- Two arrays are automatically declared; a (size 10) and b (size 12) + +PROC p(INT x, y, z) + [10]INT a: + [12]INT b: + PAR +%% +: + +PROC m() + SKIP +: + +%PASS Distinct constants + a[0] := 3 + a[1] := 4 + a[4] := 5 + +%FAIL Identical constants + a[0] := 3 + a[0] := 4 + +%PASS Same constant, different array + a[0] := 3 + b[0] := 4 + +% diff --git a/transformations/ArrayUsageCheckTest.hs b/transformations/ArrayUsageCheckTest.hs index 6daddd5..6f099b9 100644 --- a/transformations/ArrayUsageCheckTest.hs +++ b/transformations/ArrayUsageCheckTest.hs @@ -32,6 +32,7 @@ import Test.QuickCheck hiding (check) import ArrayUsageCheck import qualified AST as A import PrettyShow +import TestHarness import TestUtils hiding (m) import Utils @@ -718,6 +719,7 @@ qcTests = (TestList testArrayCheck ,testIndexes ,testMakeEquations + ,automaticTest "testcases/automatic/usage-check-1.occ.test" ] ,qcOmegaEquality ++ qcOmegaPrune)