From ad48325dffed012db62f2bdaef7faf52808953a5 Mon Sep 17 00:00:00 2001 From: Li Jie Date: Tue, 26 Nov 2024 13:21:01 +0800 Subject: [PATCH] test: regenerate test fixtures --- cl/_testdata/apkg/out.ll | 14 +++++++------- cl/_testdata/llgotag/out.ll | 14 +++++++------- cl/_testdata/print/out.ll | 10 +++++----- cl/_testgo/goroutine/out.ll | 11 ++--------- cl/_testgo/selects/out.ll | 11 ++--------- cl/_testgo/syncmap/out.ll | 2 +- cl/_testlibgo/atomic/out.ll | 8 ++------ cl/_testlibgo/complex/out.ll | 4 ++-- cl/_testlibgo/math/out.ll | 4 ++-- cl/_testpy/callpy/out.ll | 3 --- cl/_testpy/gcd/out.ll | 3 --- cl/_testpy/math/out.ll | 12 ++++++------ cl/_testpy/matrix/out.ll | 3 --- cl/_testpy/max/out.ll | 3 --- cl/_testpy/pi/out.ll | 3 --- cl/_testpy/pow/out.ll | 3 --- 16 files changed, 36 insertions(+), 72 deletions(-) diff --git a/cl/_testdata/apkg/out.ll b/cl/_testdata/apkg/out.ll index 165eea6c..adaa6e28 100644 --- a/cl/_testdata/apkg/out.ll +++ b/cl/_testdata/apkg/out.ll @@ -1,9 +1,9 @@ -; ModuleID = 'apkg' -source_filename = "apkg" +; ModuleID = 'github.com/goplus/llgo/cl/_testdata/apkg' +source_filename = "github.com/goplus/llgo/cl/_testdata/apkg" -@"apkg.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/cl/_testdata/apkg.init$guard" = global i1 false, align 1 -define double @apkg.Max(double %0, double %1) { +define double @"github.com/goplus/llgo/cl/_testdata/apkg.Max"(double %0, double %1) { _llgo_0: %2 = fcmp ogt double %0, %1 br i1 %2, label %_llgo_1, label %_llgo_2 @@ -15,13 +15,13 @@ _llgo_2: ; preds = %_llgo_0 ret double %1 } -define void @apkg.init() { +define void @"github.com/goplus/llgo/cl/_testdata/apkg.init"() { _llgo_0: - %0 = load i1, ptr @"apkg.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/cl/_testdata/apkg.init$guard", align 1 br i1 %0, label %_llgo_2, label %_llgo_1 _llgo_1: ; preds = %_llgo_0 - store i1 true, ptr @"apkg.init$guard", align 1 + store i1 true, ptr @"github.com/goplus/llgo/cl/_testdata/apkg.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 diff --git a/cl/_testdata/llgotag/out.ll b/cl/_testdata/llgotag/out.ll index 6eadd8e5..568edce1 100644 --- a/cl/_testdata/llgotag/out.ll +++ b/cl/_testdata/llgotag/out.ll @@ -1,20 +1,20 @@ -; ModuleID = 'llgotag' -source_filename = "llgotag" +; ModuleID = 'github.com/goplus/llgo/cl/_testdata/llgotag' +source_filename = "github.com/goplus/llgo/cl/_testdata/llgotag" -@"llgotag.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/cl/_testdata/llgotag.init$guard" = global i1 false, align 1 -define void @llgotag.Foo() { +define void @"github.com/goplus/llgo/cl/_testdata/llgotag.Foo"() { _llgo_0: ret void } -define void @llgotag.init() { +define void @"github.com/goplus/llgo/cl/_testdata/llgotag.init"() { _llgo_0: - %0 = load i1, ptr @"llgotag.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/cl/_testdata/llgotag.init$guard", align 1 br i1 %0, label %_llgo_2, label %_llgo_1 _llgo_1: ; preds = %_llgo_0 - store i1 true, ptr @"llgotag.init$guard", align 1 + store i1 true, ptr @"github.com/goplus/llgo/cl/_testdata/llgotag.init$guard", align 1 br label %_llgo_2 _llgo_2: ; preds = %_llgo_1, %_llgo_0 diff --git a/cl/_testdata/print/out.ll b/cl/_testdata/print/out.ll index bd2de8a7..85340317 100644 --- a/cl/_testdata/print/out.ll +++ b/cl/_testdata/print/out.ll @@ -24,7 +24,7 @@ source_filename = "main" @_llgo_int16 = linkonce global ptr null, align 8 @_llgo_int64 = linkonce global ptr null, align 8 @_llgo_int = linkonce global ptr null, align 8 -@_llgo_uint8 = linkonce global ptr null, align 8 +@_llgo_byte = linkonce global ptr null, align 8 @_llgo_uint16 = linkonce global ptr null, align 8 @_llgo_uint32 = linkonce global ptr null, align 8 @_llgo_uint64 = linkonce global ptr null, align 8 @@ -243,7 +243,7 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_3, %78 = insertvalue %"github.com/goplus/llgo/internal/runtime.eface" %77, ptr inttoptr (i64 5 to ptr), 1 store %"github.com/goplus/llgo/internal/runtime.eface" %78, ptr %75, align 8 %79 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.eface", ptr %38, i64 10 - %80 = load ptr, ptr @_llgo_uint8, align 8 + %80 = load ptr, ptr @_llgo_byte, align 8 %81 = insertvalue %"github.com/goplus/llgo/internal/runtime.eface" undef, ptr %80, 0 %82 = insertvalue %"github.com/goplus/llgo/internal/runtime.eface" %81, ptr inttoptr (i64 1 to ptr), 1 store %"github.com/goplus/llgo/internal/runtime.eface" %82, ptr %79, align 8 @@ -389,7 +389,7 @@ _llgo_14: ; preds = %_llgo_55 _llgo_15: ; preds = %_llgo_55 %25 = extractvalue %"github.com/goplus/llgo/internal/runtime.eface" %0, 0 - %26 = load ptr, ptr @_llgo_uint8, align 8 + %26 = load ptr, ptr @_llgo_byte, align 8 %27 = icmp eq ptr %25, %26 br i1 %27, label %_llgo_56, label %_llgo_57 @@ -1273,13 +1273,13 @@ _llgo_17: ; preds = %_llgo_16 br label %_llgo_18 _llgo_18: ; preds = %_llgo_17, %_llgo_16 - %27 = load ptr, ptr @_llgo_uint8, align 8 + %27 = load ptr, ptr @_llgo_byte, align 8 %28 = icmp eq ptr %27, null br i1 %28, label %_llgo_19, label %_llgo_20 _llgo_19: ; preds = %_llgo_18 %29 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 40) - store ptr %29, ptr @_llgo_uint8, align 8 + store ptr %29, ptr @_llgo_byte, align 8 br label %_llgo_20 _llgo_20: ; preds = %_llgo_19, %_llgo_18 diff --git a/cl/_testgo/goroutine/out.ll b/cl/_testgo/goroutine/out.ll index bfc48cba..b91770c7 100644 --- a/cl/_testgo/goroutine/out.ll +++ b/cl/_testgo/goroutine/out.ll @@ -2,7 +2,6 @@ source_filename = "main" %"github.com/goplus/llgo/internal/runtime.String" = type { ptr, i64 } -%"github.com/goplus/llgo/c/pthread.RoutineFunc" = type { ptr, ptr } @"main.init$guard" = global i1 false, align 1 @__llgo_argc = global i32 0, align 4 @@ -41,7 +40,7 @@ _llgo_0: %8 = getelementptr inbounds { { ptr, ptr }, %"github.com/goplus/llgo/internal/runtime.String" }, ptr %6, i32 0, i32 1 store %"github.com/goplus/llgo/internal/runtime.String" { ptr @0, i64 16 }, ptr %8, align 8 %9 = alloca i8, i64 8, align 1 - %10 = call i32 @"github.com/goplus/llgo/internal/runtime.CreateThread"(ptr %9, ptr null, %"github.com/goplus/llgo/c/pthread.RoutineFunc" { ptr @"__llgo_stub.main._llgo_routine$1", ptr null }, ptr %6) + %10 = call i32 @"github.com/goplus/llgo/internal/runtime.CreateThread"(ptr %9, ptr null, ptr @"main._llgo_routine$1", ptr %6) br label %_llgo_3 _llgo_1: ; preds = %_llgo_3 @@ -88,13 +87,7 @@ _llgo_0: declare void @free(ptr) -declare i32 @"github.com/goplus/llgo/internal/runtime.CreateThread"(ptr, ptr, %"github.com/goplus/llgo/c/pthread.RoutineFunc", ptr) - -define linkonce ptr @"__llgo_stub.main._llgo_routine$1"(ptr %0, ptr %1) { -_llgo_0: - %2 = tail call ptr @"main._llgo_routine$1"(ptr %1) - ret ptr %2 -} +declare i32 @"github.com/goplus/llgo/internal/runtime.CreateThread"(ptr, ptr, ptr, ptr) declare void @"github.com/goplus/llgo/internal/runtime.PrintString"(%"github.com/goplus/llgo/internal/runtime.String") diff --git a/cl/_testgo/selects/out.ll b/cl/_testgo/selects/out.ll index 595d2ce3..6196d5c7 100644 --- a/cl/_testgo/selects/out.ll +++ b/cl/_testgo/selects/out.ll @@ -1,7 +1,6 @@ ; ModuleID = 'main' source_filename = "main" -%"github.com/goplus/llgo/c/pthread.RoutineFunc" = type { ptr, ptr } %"github.com/goplus/llgo/internal/runtime.String" = type { ptr, i64 } %"github.com/goplus/llgo/internal/runtime.ChanOp" = type { ptr, ptr, i32, i1 } %"github.com/goplus/llgo/internal/runtime.Slice" = type { ptr, i64, i64 } @@ -61,7 +60,7 @@ _llgo_0: %15 = getelementptr inbounds { { ptr, ptr } }, ptr %14, i32 0, i32 0 store { ptr, ptr } %13, ptr %15, align 8 %16 = alloca i8, i64 8, align 1 - %17 = call i32 @"github.com/goplus/llgo/internal/runtime.CreateThread"(ptr %16, ptr null, %"github.com/goplus/llgo/c/pthread.RoutineFunc" { ptr @"__llgo_stub.main._llgo_routine$1", ptr null }, ptr %14) + %17 = call i32 @"github.com/goplus/llgo/internal/runtime.CreateThread"(ptr %16, ptr null, ptr @"main._llgo_routine$1", ptr %14) %18 = load ptr, ptr %2, align 8 %19 = alloca {}, align 8 call void @llvm.memset(ptr %19, i8 0, i64 0, i1 false) @@ -230,13 +229,7 @@ _llgo_0: declare void @free(ptr) -declare i32 @"github.com/goplus/llgo/internal/runtime.CreateThread"(ptr, ptr, %"github.com/goplus/llgo/c/pthread.RoutineFunc", ptr) - -define linkonce ptr @"__llgo_stub.main._llgo_routine$1"(ptr %0, ptr %1) { -_llgo_0: - %2 = tail call ptr @"main._llgo_routine$1"(ptr %1) - ret ptr %2 -} +declare i32 @"github.com/goplus/llgo/internal/runtime.CreateThread"(ptr, ptr, ptr, ptr) declare i1 @"github.com/goplus/llgo/internal/runtime.ChanSend"(ptr, ptr, i64) diff --git a/cl/_testgo/syncmap/out.ll b/cl/_testgo/syncmap/out.ll index b9327d67..f2fc8ac2 100644 --- a/cl/_testgo/syncmap/out.ll +++ b/cl/_testgo/syncmap/out.ll @@ -38,7 +38,7 @@ _llgo_0: store ptr %1, ptr @__llgo_argv, align 8 call void @"github.com/goplus/llgo/internal/runtime.init"() call void @main.init() - %2 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64 32) + %2 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64 88) %3 = load ptr, ptr @_llgo_int, align 8 %4 = insertvalue %"github.com/goplus/llgo/internal/runtime.eface" undef, ptr %3, 0 %5 = insertvalue %"github.com/goplus/llgo/internal/runtime.eface" %4, ptr inttoptr (i64 1 to ptr), 1 diff --git a/cl/_testlibgo/atomic/out.ll b/cl/_testlibgo/atomic/out.ll index e206c8c2..765b0452 100644 --- a/cl/_testlibgo/atomic/out.ll +++ b/cl/_testlibgo/atomic/out.ll @@ -32,8 +32,8 @@ _llgo_0: call void @"github.com/goplus/llgo/internal/runtime.init"() call void @main.init() %2 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64 8) - call void @"sync/atomic.StoreInt64"(ptr %2, i64 100) - %3 = call i64 @"sync/atomic.LoadInt64"(ptr %2) + store atomic i64 100, ptr %2 seq_cst, align 4 + %3 = load atomic i64, ptr %2 seq_cst, align 4 call void @"github.com/goplus/llgo/internal/runtime.PrintString"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @0, i64 6 }) call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/internal/runtime.PrintInt"(i64 %3) @@ -87,10 +87,6 @@ declare void @"github.com/goplus/llgo/internal/runtime.init"() declare ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64) -declare void @"sync/atomic.StoreInt64"(ptr, i64) - -declare i64 @"sync/atomic.LoadInt64"(ptr) - declare void @"github.com/goplus/llgo/internal/runtime.PrintString"(%"github.com/goplus/llgo/internal/runtime.String") declare void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8) diff --git a/cl/_testlibgo/complex/out.ll b/cl/_testlibgo/complex/out.ll index d89ac2fb..a7c5af4e 100644 --- a/cl/_testlibgo/complex/out.ll +++ b/cl/_testlibgo/complex/out.ll @@ -12,7 +12,7 @@ source_filename = "main" define void @main.f({ double, double } %0, { double, double } %1) { _llgo_0: - %2 = call double @"math/cmplx.Abs"({ double, double } %0) + %2 = call double @cabs({ double, double } %0) call void @"github.com/goplus/llgo/internal/runtime.PrintString"(%"github.com/goplus/llgo/internal/runtime.String" { ptr @0, i64 10 }) call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 32) call void @"github.com/goplus/llgo/internal/runtime.PrintFloat"(double %2) @@ -54,7 +54,7 @@ _llgo_0: ret i32 0 } -declare double @"math/cmplx.Abs"({ double, double }) +declare double @cabs({ double, double }) declare void @"github.com/goplus/llgo/internal/runtime.PrintString"(%"github.com/goplus/llgo/internal/runtime.String") diff --git a/cl/_testlibgo/math/out.ll b/cl/_testlibgo/math/out.ll index e7ee0e64..deb4b57e 100644 --- a/cl/_testlibgo/math/out.ll +++ b/cl/_testlibgo/math/out.ll @@ -25,7 +25,7 @@ _llgo_0: store ptr %1, ptr @__llgo_argv, align 8 call void @"github.com/goplus/llgo/internal/runtime.init"() call void @main.init() - %2 = call double @math.Sqrt(double 2.000000e+00) + %2 = call double @sqrt(double 2.000000e+00) call void @"github.com/goplus/llgo/internal/runtime.PrintFloat"(double %2) call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 10) %3 = call double @math.Abs(double -1.200000e+00) @@ -41,7 +41,7 @@ declare void @math.init() declare void @"github.com/goplus/llgo/internal/runtime.init"() -declare double @math.Sqrt(double) +declare double @sqrt(double) declare void @"github.com/goplus/llgo/internal/runtime.PrintFloat"(double) diff --git a/cl/_testpy/callpy/out.ll b/cl/_testpy/callpy/out.ll index 25ccfebb..484cf44e 100644 --- a/cl/_testpy/callpy/out.ll +++ b/cl/_testpy/callpy/out.ll @@ -40,7 +40,6 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 define i32 @main(i32 %0, ptr %1) { _llgo_0: - call void @Py_Initialize() store i32 %0, ptr @__llgo_argc, align 4 store ptr %1, ptr @__llgo_argv, align 8 call void @"github.com/goplus/llgo/internal/runtime.init"() @@ -81,5 +80,3 @@ declare ptr @PyUnicode_FromString(ptr) declare ptr @PyObject_CallFunctionObjArgs(ptr, ...) declare void @llgoLoadPyModSyms(ptr, ...) - -declare void @Py_Initialize() diff --git a/cl/_testpy/gcd/out.ll b/cl/_testpy/gcd/out.ll index fbc24887..0fdec606 100644 --- a/cl/_testpy/gcd/out.ll +++ b/cl/_testpy/gcd/out.ll @@ -27,7 +27,6 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 define i32 @main(i32 %0, ptr %1) { _llgo_0: - call void @Py_Initialize() store i32 %0, ptr @__llgo_argc, align 4 store ptr %1, ptr @__llgo_argv, align 8 call void @"github.com/goplus/llgo/internal/runtime.init"() @@ -55,5 +54,3 @@ declare i64 @PyLong_AsLong(ptr) declare i32 @printf(ptr, ...) declare void @llgoLoadPyModSyms(ptr, ...) - -declare void @Py_Initialize() diff --git a/cl/_testpy/math/out.ll b/cl/_testpy/math/out.ll index 746b550c..9eeddcbc 100644 --- a/cl/_testpy/math/out.ll +++ b/cl/_testpy/math/out.ll @@ -1,17 +1,17 @@ -; ModuleID = 'math' -source_filename = "math" +; ModuleID = 'github.com/goplus/llgo/cl/_testpy/math' +source_filename = "github.com/goplus/llgo/cl/_testpy/math" -@"math.init$guard" = global i1 false, align 1 +@"github.com/goplus/llgo/cl/_testpy/math.init$guard" = global i1 false, align 1 @__llgo_py.math = linkonce global ptr null, align 8 @0 = private unnamed_addr constant [5 x i8] c"math\00", align 1 -define void @math.init() { +define void @"github.com/goplus/llgo/cl/_testpy/math.init"() { _llgo_0: - %0 = load i1, ptr @"math.init$guard", align 1 + %0 = load i1, ptr @"github.com/goplus/llgo/cl/_testpy/math.init$guard", align 1 br i1 %0, label %_llgo_2, label %_llgo_1 _llgo_1: ; preds = %_llgo_0 - store i1 true, ptr @"math.init$guard", align 1 + store i1 true, ptr @"github.com/goplus/llgo/cl/_testpy/math.init$guard", align 1 %1 = load ptr, ptr @__llgo_py.math, align 8 %2 = icmp ne ptr %1, null br i1 %2, label %_llgo_2, label %_llgo_3 diff --git a/cl/_testpy/matrix/out.ll b/cl/_testpy/matrix/out.ll index 20548694..7fe94c57 100644 --- a/cl/_testpy/matrix/out.ll +++ b/cl/_testpy/matrix/out.ll @@ -29,7 +29,6 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 define i32 @main(i32 %0, ptr %1) { _llgo_0: - call void @Py_Initialize() store i32 %0, ptr @__llgo_argc, align 4 store ptr %1, ptr @__llgo_argv, align 8 call void @"github.com/goplus/llgo/internal/runtime.init"() @@ -117,5 +116,3 @@ declare ptr @PyUnicode_AsUTF8(ptr) declare i32 @printf(ptr, ...) declare void @llgoLoadPyModSyms(ptr, ...) - -declare void @Py_Initialize() diff --git a/cl/_testpy/max/out.ll b/cl/_testpy/max/out.ll index 3eae5bed..46b66d48 100644 --- a/cl/_testpy/max/out.ll +++ b/cl/_testpy/max/out.ll @@ -30,7 +30,6 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 define i32 @main(i32 %0, ptr %1) { _llgo_0: - call void @Py_Initialize() store i32 %0, ptr @__llgo_argc, align 4 store ptr %1, ptr @__llgo_argv, align 8 call void @"github.com/goplus/llgo/internal/runtime.init"() @@ -93,5 +92,3 @@ declare ptr @PyTuple_New(i64) declare i32 @PyTuple_SetItem(ptr, i64, ptr) declare void @llgoLoadPyModSyms(ptr, ...) - -declare void @Py_Initialize() diff --git a/cl/_testpy/pi/out.ll b/cl/_testpy/pi/out.ll index 0a6225de..083e6d54 100644 --- a/cl/_testpy/pi/out.ll +++ b/cl/_testpy/pi/out.ll @@ -24,7 +24,6 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 define i32 @main(i32 %0, ptr %1) { _llgo_0: - call void @Py_Initialize() store i32 %0, ptr @__llgo_argc, align 4 store ptr %1, ptr @__llgo_argv, align 8 call void @"github.com/goplus/llgo/internal/runtime.init"() @@ -45,5 +44,3 @@ declare ptr @PyObject_GetAttrString(ptr, ptr) declare double @PyFloat_AsDouble(ptr) declare i32 @printf(ptr, ...) - -declare void @Py_Initialize() diff --git a/cl/_testpy/pow/out.ll b/cl/_testpy/pow/out.ll index 5807c6f3..29ee34d2 100644 --- a/cl/_testpy/pow/out.ll +++ b/cl/_testpy/pow/out.ll @@ -27,7 +27,6 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0 define i32 @main(i32 %0, ptr %1) { _llgo_0: - call void @Py_Initialize() store i32 %0, ptr @__llgo_argc, align 4 store ptr %1, ptr @__llgo_argv, align 8 call void @"github.com/goplus/llgo/internal/runtime.init"() @@ -54,5 +53,3 @@ declare double @PyFloat_AsDouble(ptr) declare i32 @printf(ptr, ...) declare void @llgoLoadPyModSyms(ptr, ...) - -declare void @Py_Initialize()