2023-05-16 14:42:44 +03:00
|
|
|
module Core.VampIR.LetHoist where
|
|
|
|
|
|
|
|
import Base
|
|
|
|
import Core.Normalize.Positive (PosTest (..))
|
|
|
|
import Core.Normalize.Positive qualified as Normalize
|
|
|
|
import Core.VampIR.Base
|
|
|
|
import Juvix.Compiler.Core.Data.TransformationId
|
|
|
|
|
|
|
|
fromTest :: PosTest -> TestTree
|
|
|
|
fromTest = mkTest . toTestDescr
|
|
|
|
|
|
|
|
toTestDescr :: PosTest -> TestDescr
|
2024-06-28 13:15:51 +03:00
|
|
|
toTestDescr = Normalize.toTestDescr' (const (coreVampIRAssertion [LetHoisting]))
|
2023-05-16 14:42:44 +03:00
|
|
|
|
|
|
|
allTests :: TestTree
|
|
|
|
allTests =
|
|
|
|
testGroup
|
|
|
|
"JuvixCore VampIR let-hoist positive tests"
|
|
|
|
(map (mkTest . toTestDescr) tests)
|
|
|
|
|
|
|
|
tests :: [PosTest]
|
|
|
|
tests =
|
|
|
|
[ PosTest
|
|
|
|
"Test010: Lets"
|
2023-05-22 21:18:18 +03:00
|
|
|
$(mkRelDir "Core")
|
2023-05-16 14:42:44 +03:00
|
|
|
$(mkRelFile "test010.jvc")
|
|
|
|
$(mkRelFile "data/test010.json"),
|
|
|
|
PosTest
|
|
|
|
"Test028: Let hoisting"
|
2023-05-22 21:18:18 +03:00
|
|
|
$(mkRelDir "Core")
|
2023-05-16 14:42:44 +03:00
|
|
|
$(mkRelFile "test028.jvc")
|
|
|
|
$(mkRelFile "data/test028.json"),
|
|
|
|
PosTest
|
|
|
|
"Test029: Let hoisting"
|
2023-05-22 21:18:18 +03:00
|
|
|
$(mkRelDir "Core")
|
2023-05-16 14:42:44 +03:00
|
|
|
$(mkRelFile "test029.jvc")
|
|
|
|
$(mkRelFile "data/test029.json")
|
|
|
|
]
|