compiler: make main function normally to compatible multiple main functions in testing mode

This commit is contained in:
Li Jie
2025-01-13 09:37:26 +08:00
parent 5cfeddef73
commit 85d01d6f28
6 changed files with 64 additions and 72 deletions

View File

@@ -152,10 +152,6 @@ func TestCompileEx(t *testing.T, src any, fname, expected string, dbg bool) {
t.Fatal("cl.NewPackage failed:", err)
}
if prog.NeedPyInit { // call PyInit if needed
ret.PyInit()
}
if v := ret.String(); v != expected && expected != ";" { // expected == ";" means skipping out.ll
t.Fatalf("\n==> got:\n%s\n==> expected:\n%s\n", v, expected)
}