From 8f7c8b9fcb8c4db8692b9fc1e3feaf84600af778 Mon Sep 17 00:00:00 2001 From: Adam Sampson Date: Sun, 6 Apr 2008 13:12:04 +0000 Subject: [PATCH] Define variables necessary for some of the constant-folding tests. --- frontends/OccamPassesTest.hs | 1 + frontends/RainTypesTest.hs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/frontends/OccamPassesTest.hs b/frontends/OccamPassesTest.hs index 0299053..a718872 100644 --- a/frontends/OccamPassesTest.hs +++ b/frontends/OccamPassesTest.hs @@ -45,6 +45,7 @@ startState undefined defineConst "someBytes" (A.Array [A.UnknownDimension] A.Byte) undefined + defineVariable "var" A.Int -- | Test 'OccamPasses.foldConstants'. testFoldConstants :: Test diff --git a/frontends/RainTypesTest.hs b/frontends/RainTypesTest.hs index 6c7a542..4150679 100644 --- a/frontends/RainTypesTest.hs +++ b/frontends/RainTypesTest.hs @@ -66,7 +66,7 @@ constantFoldTest = TestList foldCon n exp orig = TestCase $ testPass ("constantFoldTest " ++ show n) (buildExprPattern exp) (constantFoldPass $ buildExpr orig) state state :: State CompState () - state = return () + state = defineVariable "x" A.Int64 lit :: Integer -> ExprHelper lit n = Lit $ int64Literal n