llgo/ssa: b.NewPyModVar, b.ImportPyMod, PyObjectPtr, PyObjectPtrPtr

This commit is contained in:
xushiwei
2024-05-11 15:07:50 +08:00
parent 00222c7808
commit 97cb312386
7 changed files with 139 additions and 23 deletions

View File

@@ -147,6 +147,13 @@ func TestCompileEx(t *testing.T, src any, fname, expected string) {
}
return rt
})
prog.SetPython(func() *types.Package {
rt, err := imp.Import(llssa.PkgPython)
if err != nil {
t.Fatal("load python failed:", err)
}
return rt
})
ret, err := cl.NewPackage(prog, foo, files)
if err != nil {