Skip to content

Commit

Permalink
add bug repro
Browse files Browse the repository at this point in the history
  • Loading branch information
oflatt committed Jan 31, 2024
1 parent cfa2608 commit a86aef9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/rvsdg/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,15 @@ fn rvsdg_state_gamma() {
assert!(deep_equal(&expected, &rvsdg.functions[0]));
}

#[test]
fn harder_unstructured() {
const PROGRAM: &str = include_str!("../../tests/small/harder_unstructured.bril");
let prog = parse_from_string(PROGRAM);
let cfg = program_to_cfg(&prog);
let rvsdg = &cfg_to_rvsdg(&cfg).unwrap().functions[0];
eprintln!("{}", rvsdg.to_svg());
}

#[test]
fn rvsdg_unstructured() {
const PROGRAM: &str = r#"@main(): int {
Expand Down
13 changes: 13 additions & 0 deletions tests/small/harder_unstructured.bril
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@main(): int {
x: int = const 4;
a_cond: bool = lt x x;
br a_cond .B .C;
.B:
br a_cond .C .D;
.C:
br a_cond .D .End;
.D:
jmp .End;
.End:
ret x;
}

0 comments on commit a86aef9

Please sign in to comment.