}
}
+ if len(f.Entry.Preds) > 0 {
+ f.Fatalf("entry block %s of %s has predecessor(s) %v", f.Entry, f.Name, f.Entry.Preds)
+ }
+
// Check to make sure all Values referenced are in the function.
for _, b := range f.Blocks {
for _, v := range b.Values {
c := testConfig(t)
fun := Fun(c, "entry",
Bloc("entry",
+ Goto("first")),
+ Bloc("first",
Valu("mem", OpArg, TypeMem, 0, ".mem"),
Valu("p", OpConstBool, TypeBool, 0, true),
Goto("a")),
Bloc("a",
- If("p", "b", "entry")),
+ If("p", "b", "first")),
Bloc("b",
Goto("c")),
Bloc("c",
Exit("mem")))
doms := map[string]string{
- "a": "entry",
- "b": "a",
- "c": "b",
- "exit": "c",
+ "first": "entry",
+ "a": "first",
+ "b": "a",
+ "c": "b",
+ "exit": "c",
}
CheckFunc(fun.f)