Define variables necessary for some of the constant-folding tests.
This commit is contained in:
parent
118a1f3527
commit
8f7c8b9fcb
|
@ -45,6 +45,7 @@ startState
|
||||||
undefined
|
undefined
|
||||||
defineConst "someBytes" (A.Array [A.UnknownDimension] A.Byte)
|
defineConst "someBytes" (A.Array [A.UnknownDimension] A.Byte)
|
||||||
undefined
|
undefined
|
||||||
|
defineVariable "var" A.Int
|
||||||
|
|
||||||
-- | Test 'OccamPasses.foldConstants'.
|
-- | Test 'OccamPasses.foldConstants'.
|
||||||
testFoldConstants :: Test
|
testFoldConstants :: Test
|
||||||
|
|
|
@ -66,7 +66,7 @@ constantFoldTest = TestList
|
||||||
foldCon n exp orig = TestCase $ testPass ("constantFoldTest " ++ show n) (buildExprPattern exp) (constantFoldPass $ buildExpr orig) state
|
foldCon n exp orig = TestCase $ testPass ("constantFoldTest " ++ show n) (buildExprPattern exp) (constantFoldPass $ buildExpr orig) state
|
||||||
|
|
||||||
state :: State CompState ()
|
state :: State CompState ()
|
||||||
state = return ()
|
state = defineVariable "x" A.Int64
|
||||||
|
|
||||||
lit :: Integer -> ExprHelper
|
lit :: Integer -> ExprHelper
|
||||||
lit n = Lit $ int64Literal n
|
lit n = Lit $ int64Literal n
|
||||||
|
|
Loading…
Reference in New Issue
Block a user