oxc/crates/oxc_semantic/tests/integration/snapshots/while.snap
IWANABETHATGUY 805fbac44c feat(oxc_cfg): better control flow graph dot dot repr (#5731)
1. add basic block index for each basicblock, so there should no basic block display empty string
2. use `shape` box, since it is basic **block**
## Before
![image](https://github.com/user-attachments/assets/9b556cca-8401-40bd-b3b6-d31c5e7cf8ba)

## After
![image](https://github.com/user-attachments/assets/b8e4c52d-ecdf-4e92-85be-ea37f0cb2330)
2024-09-12 18:39:01 +00:00

96 lines
1.8 KiB
Text

---
source: crates/oxc_semantic/tests/integration/cfg.rs
expression: snapshot
input_file: crates/oxc_semantic/tests/integration/cfg_fixtures/while.js
---
bb0: {
}
bb1: {
}
bb2: {
}
bb3: {
statement
}
bb4: {
condition
}
bb5: {
}
bb6: {
}
bb7: {
statement
return <value>
}
bb8: {
unreachable
}
bb9: {
return <value>
}
bb10: {
unreachable
}
bb11: {
}
digraph {
0 [ label = "bb0" shape = box]
1 [ label = "bb1" shape = box]
2 [ label = "bb2" shape = box]
3 [ label = "bb3
WhileStatement" shape = box]
4 [ label = "bb4
Condition(LogicalExpression)" shape = box]
5 [ label = "bb5" shape = box]
6 [ label = "bb6" shape = box]
7 [ label = "bb7
BlockStatement
return <value>" shape = box]
8 [ label = "bb8
unreachable" shape = box]
9 [ label = "bb9
return <value>" shape = box]
10 [ label = "bb10
unreachable" shape = box]
11 [ label = "bb11" shape = box]
1 -> 0 [ label = "Error(Implicit)" ]
3 -> 2 [ label = "Error(Implicit)" ]
1 -> 3 [ label = "NewFunction" ]
4 -> 2 [ label = "Error(Implicit)" ]
5 -> 2 [ label = "Error(Implicit)" ]
6 -> 2 [ label = "Error(Implicit)" ]
4 -> 5 [ label = "Normal" ]
4 -> 6 [ label = "Normal" ]
5 -> 6 [ label = "Normal" ]
7 -> 2 [ label = "Error(Implicit)" ]
8 -> 2 [ label = "Error(Implicit)" , style = "dotted" ]
7 -> 8 [ label = "Unreachable" , style = "dotted" ]
9 -> 2 [ label = "Error(Implicit)" ]
3 -> 4 [ label = "Normal" ]
4 -> 7 [ label = "Jump" ]
8 -> 4 [ label = "Backedge" , style = "dotted" ]
4 -> 9 [ label = "Normal" ]
10 -> 2 [ label = "Error(Implicit)" , style = "dotted" ]
9 -> 10 [ label = "Unreachable" , style = "dotted" ]
11 -> 0 [ label = "Error(Implicit)" ]
1 -> 11 [ label = "Normal" ]
}