use cl/blocks

This commit is contained in:
xushiwei
2024-06-05 15:08:05 +08:00
parent fd7d2765c8
commit fe548e580d
2 changed files with 16 additions and 22 deletions

View File

@@ -41,6 +41,17 @@ func TestTestdefer(t *testing.T) {
fromDir(t, "", "../_testdefer")
}
func TestFirstLoop(t *testing.T) {
blk := &ssa.BasicBlock{}
blk.Index = 0
blk.Preds = []*ssa.BasicBlock{blk}
blk.Succs = []*ssa.BasicBlock{blk}
infos := Infos([]*ssa.BasicBlock{blk})
if infos[0].Kind != llssa.DeferInLoop {
t.Fatal("TestFirstLoop")
}
}
func fromDir(t *testing.T, sel, relDir string) {
dir, err := os.Getwd()
if err != nil {