diff --git a/chore/gentests/gentests.go b/chore/gentests/gentests.go index bb34a1a7..2a8c2214 100644 --- a/chore/gentests/gentests.go +++ b/chore/gentests/gentests.go @@ -33,7 +33,7 @@ func main() { llgenDir(dir + "/cl/_testlibc") llgenDir(dir + "/cl/_testrt") - llgenDir(dir + "/cl/_testpy") + llgenDir(dir+"/cl/_testpy", "") llgenDir(dir+"/cl/_testdata", "") } diff --git a/cl/_testpy/math/out.ll b/cl/_testpy/math/out.ll index 66f80e8f..378284c6 100644 --- a/cl/_testpy/math/out.ll +++ b/cl/_testpy/math/out.ll @@ -1,19 +1,19 @@ -; ModuleID = 'command-line-arguments' -source_filename = "command-line-arguments" +; ModuleID = 'math' +source_filename = "math" @__llgo_py.math.sqrt = external global ptr -@"command-line-arguments.init$guard" = global ptr null +@"math.init$guard" = global ptr null @__llgo_py.math = linkonce global ptr null @0 = private unnamed_addr constant [5 x i8] c"math\00", align 1 @1 = private unnamed_addr constant [5 x i8] c"sqrt\00", align 1 -define void @command-line-arguments.init() { +define void @math.init() { _llgo_0: - %0 = load i1, ptr @"command-line-arguments.init$guard", align 1 + %0 = load i1, ptr @"math.init$guard", align 1 br i1 %0, label %_llgo_2, label %_llgo_1 _llgo_1: ; preds = %_llgo_0 - store i1 true, ptr @"command-line-arguments.init$guard", align 1 + store i1 true, ptr @"math.init$guard", align 1 %1 = load ptr, ptr @__llgo_py.math, align 8 call void (ptr, ...) @llgoLoadPyModSyms(ptr %1, ptr @1, ptr @__llgo_py.math.sqrt, ptr null) %2 = load ptr, ptr @__llgo_py.math, align 8 diff --git a/cl/compile_test.go b/cl/compile_test.go index a1237888..6f417cbe 100644 --- a/cl/compile_test.go +++ b/cl/compile_test.go @@ -29,7 +29,7 @@ func testCompile(t *testing.T, src, expected string) { } func TestFromTestpy(t *testing.T) { - cltest.FromDir(t, "callpy", "./_testpy", false) + cltest.FromDir(t, "", "./_testpy", false) } func TestFromTestlibc(t *testing.T) { diff --git a/py/math/llgo_autogen.lla b/py/math/llgo_autogen.lla index 7c9261cd..8eaa159b 100644 Binary files a/py/math/llgo_autogen.lla and b/py/math/llgo_autogen.lla differ diff --git a/py/os/llgo_autogen.lla b/py/os/llgo_autogen.lla index a8378f7b..d9ad409c 100644 Binary files a/py/os/llgo_autogen.lla and b/py/os/llgo_autogen.lla differ diff --git a/x/sqlite/sqlite.ll b/x/sqlite/sqlite.ll index 2acb9d94..d4bdb25a 100644 --- a/x/sqlite/sqlite.ll +++ b/x/sqlite/sqlite.ll @@ -8,7 +8,7 @@ source_filename = "github.com/goplus/llgo/x/sqlite" define ptr @"(*github.com/goplus/llgo/x/sqlite.Errno).Errstr"(ptr %0) { _llgo_0: %1 = load i32, ptr %0, align 4 - %2 = call ptr @sqlite3_errstr() + %2 = call ptr @sqlite3_errstr(i32 %1) ret ptr %2 } @@ -84,7 +84,7 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 ret void } -declare ptr @sqlite3_errstr() +declare ptr @sqlite3_errstr(i32) declare ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64) @@ -92,8 +92,8 @@ declare i32 @sqlite3_open(ptr, ptr) declare i32 @sqlite3_open_v2(ptr, ptr, i32, ptr) -declare i32 @sqlite3_prepare(ptr, i32, ptr, ptr) +declare i32 @sqlite3_prepare(ptr, ptr, i32, ptr, ptr) -declare i32 @sqlite3_prepare_v2(ptr, i32, ptr, ptr) +declare i32 @sqlite3_prepare_v2(ptr, ptr, i32, ptr, ptr) -declare i32 @sqlite3_prepare_v3(ptr, i32, i32, ptr, ptr) +declare i32 @sqlite3_prepare_v3(ptr, ptr, i32, i32, ptr, ptr)