[validation] Add regression tests for cBench-v0/susan.
Reproducing
@@ -36,5 +36,37 @@ def test_validate_strucutrizecfg_ghostscript(env: LlvmEnv):
assert env.validate().okay()
+@pytest.mark.xfail(
+ strict=True, reason="github.com/facebookresearch/CompilerGym/issues/105"
+)
+def test_validate_susan_a(env: LlvmEnv):
+ env.reset("cBench-v0/susan")
+ env.step(env.action_space["-structurizecfg"])
+ env.step(env.action_space["-loop-extract"])
+ env.step(env.action_space["-mergereturn"])
+ env.step(env.action_space["-structurizecfg"])
+ env.step(env.action_space["-loop-extract"])
+ env.step(env.action_space["-mergereturn"])
+ assert env.validate().okay()
+
+
+@pytest.mark.xfail(
+ strict=True, reason="github.com/facebookresearch/CompilerGym/issues/105"
+)
+def test_validate_susan_b(env: LlvmEnv):
+ env.reset("cBench-v0/susan")
+ env.step(env.action_space["-mem2reg"])
+ env.step(env.action_space["-simplifycfg"])
+ env.step(env.action_space["-lcssa"])
+ env.step(env.action_space["-break-crit-edges"])
+ env.step(env.action_space["-newgvn"])
+ env.step(env.action_space["-mem2reg"])
+ env.step(env.action_space["-simplifycfg"])
+ env.step(env.action_space["-lcssa"])
+ env.step(env.action_space["-break-crit-edges"])
+ env.step(env.action_space["-newgvn"])
+ assert env.validate().okay()
+
+
if __name__ == "__main__":
main()
