Skip to content

Commit

Permalink
add a test case of a casetype with identical branches
Browse files Browse the repository at this point in the history
  • Loading branch information
nikswamy committed Oct 22, 2024
1 parent 3cdfc78 commit ed220ad
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
3 changes: 0 additions & 3 deletions src/3d/TranslateForInterpreter.fst
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,6 @@ let dep_pair_with_action_parser p1 (a:T.lam T.action) (p2:A.ident & T.parser) =
let extend_fieldname fieldname e = Printf.sprintf "%s.%s" fieldname e
let ite_parser typename fieldname (e:T.expr) (then_:T.parser) (else_:T.parser) : ML T.parser =
let k, p1, p2 =
// if T.parser_kind_eq then_.p_kind else_.p_kind
// then then_.p_kind, then_, else_
// else
let k = pk_glb then_.p_kind else_.p_kind in
k,
mk_parser k then_.p_typ typename (extend_fieldname fieldname "case_left") (T.Parse_weaken_right then_ else_.p_kind),
Expand Down
14 changes: 13 additions & 1 deletion src/3d/tests/BoolSwitch.3d
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,16 @@ casetype _T (Bool b)
case false:
UINT32 integer;
}
} T;
} T;

entrypoint
casetype _S (Bool b)
{
switch (b)
{
case true:
UINT32 f;
default:
UINT32 g;
}
} S;

0 comments on commit ed220ad

Please sign in to comment.