test: regenerate test files with gentests
This commit is contained in:
@@ -1,97 +1,89 @@
|
||||
; ModuleID = 'main'
|
||||
source_filename = "main"
|
||||
; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testlibc/allocacstrs'
|
||||
source_filename = "github.com/goplus/llgo/compiler/cl/_testlibc/allocacstrs"
|
||||
|
||||
%"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 }
|
||||
%"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 }
|
||||
|
||||
@"main.init$guard" = global i1 false, align 1
|
||||
@__llgo_argc = global i32 0, align 4
|
||||
@__llgo_argv = global ptr null, align 8
|
||||
@"github.com/goplus/llgo/compiler/cl/_testlibc/allocacstrs.init$guard" = global i1 false, align 1
|
||||
@0 = private unnamed_addr constant [1 x i8] c"a", align 1
|
||||
@1 = private unnamed_addr constant [1 x i8] c"b", align 1
|
||||
@2 = private unnamed_addr constant [1 x i8] c"c", align 1
|
||||
@3 = private unnamed_addr constant [4 x i8] c"%s\0A\00", align 1
|
||||
|
||||
define void @main.init() {
|
||||
define void @"github.com/goplus/llgo/compiler/cl/_testlibc/allocacstrs.init"() {
|
||||
_llgo_0:
|
||||
%0 = load i1, ptr @"main.init$guard", align 1
|
||||
%0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/allocacstrs.init$guard", align 1
|
||||
br i1 %0, label %_llgo_2, label %_llgo_1
|
||||
|
||||
_llgo_1: ; preds = %_llgo_0
|
||||
store i1 true, ptr @"main.init$guard", align 1
|
||||
store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/allocacstrs.init$guard", align 1
|
||||
br label %_llgo_2
|
||||
|
||||
_llgo_2: ; preds = %_llgo_1, %_llgo_0
|
||||
ret void
|
||||
}
|
||||
|
||||
define i32 @main(i32 %0, ptr %1) {
|
||||
define void @"github.com/goplus/llgo/compiler/cl/_testlibc/allocacstrs.main"() {
|
||||
_llgo_0:
|
||||
store i32 %0, ptr @__llgo_argc, align 4
|
||||
store ptr %1, ptr @__llgo_argv, align 8
|
||||
call void @"github.com/goplus/llgo/runtime/internal/runtime.init"()
|
||||
call void @main.init()
|
||||
%2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 48)
|
||||
%3 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %2, i64 0
|
||||
store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 1 }, ptr %3, align 8
|
||||
%4 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %2, i64 1
|
||||
store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 1 }, ptr %4, align 8
|
||||
%5 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %2, i64 2
|
||||
store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 1 }, ptr %5, align 8
|
||||
%6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %2, 0
|
||||
%7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %6, i64 3, 1
|
||||
%8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, i64 3, 2
|
||||
%9 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %8, 1
|
||||
%10 = add i64 %9, 1
|
||||
%11 = alloca ptr, i64 %10, align 8
|
||||
%0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 48)
|
||||
%1 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %0, i64 0
|
||||
store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 1 }, ptr %1, align 8
|
||||
%2 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %0, i64 1
|
||||
store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 1 }, ptr %2, align 8
|
||||
%3 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %0, i64 2
|
||||
store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 1 }, ptr %3, align 8
|
||||
%4 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %0, 0
|
||||
%5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %4, i64 3, 1
|
||||
%6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %5, i64 3, 2
|
||||
%7 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %6, 1
|
||||
%8 = add i64 %7, 1
|
||||
%9 = alloca ptr, i64 %8, align 8
|
||||
br label %_llgo_4
|
||||
|
||||
_llgo_1: ; preds = %_llgo_3, %_llgo_6
|
||||
%12 = phi i64 [ 0, %_llgo_6 ], [ %17, %_llgo_3 ]
|
||||
%13 = getelementptr ptr, ptr %11, i64 %12
|
||||
%14 = load ptr, ptr %13, align 8
|
||||
%15 = icmp eq ptr %14, null
|
||||
br i1 %15, label %_llgo_2, label %_llgo_3
|
||||
%10 = phi i64 [ 0, %_llgo_6 ], [ %15, %_llgo_3 ]
|
||||
%11 = getelementptr ptr, ptr %9, i64 %10
|
||||
%12 = load ptr, ptr %11, align 8
|
||||
%13 = icmp eq ptr %12, null
|
||||
br i1 %13, label %_llgo_2, label %_llgo_3
|
||||
|
||||
_llgo_2: ; preds = %_llgo_1
|
||||
ret i32 0
|
||||
ret void
|
||||
|
||||
_llgo_3: ; preds = %_llgo_1
|
||||
%16 = call i32 (ptr, ...) @printf(ptr @3, ptr %14)
|
||||
%17 = add i64 %12, 1
|
||||
%14 = call i32 (ptr, ...) @printf(ptr @3, ptr %12)
|
||||
%15 = add i64 %10, 1
|
||||
br label %_llgo_1
|
||||
|
||||
_llgo_4: ; preds = %_llgo_5, %_llgo_0
|
||||
%18 = phi i64 [ 0, %_llgo_0 ], [ %32, %_llgo_5 ]
|
||||
%19 = icmp slt i64 %18, %9
|
||||
br i1 %19, label %_llgo_5, label %_llgo_6
|
||||
%16 = phi i64 [ 0, %_llgo_0 ], [ %30, %_llgo_5 ]
|
||||
%17 = icmp slt i64 %16, %7
|
||||
br i1 %17, label %_llgo_5, label %_llgo_6
|
||||
|
||||
_llgo_5: ; preds = %_llgo_4
|
||||
%20 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %8, 0
|
||||
%21 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %8, 1
|
||||
%22 = icmp slt i64 %18, 0
|
||||
%23 = icmp sge i64 %18, %21
|
||||
%24 = or i1 %23, %22
|
||||
call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %24)
|
||||
%25 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %20, i64 %18
|
||||
%26 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %25, align 8
|
||||
%27 = getelementptr ptr, ptr %11, i64 %18
|
||||
%28 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %26, 1
|
||||
%29 = add i64 %28, 1
|
||||
%30 = alloca i8, i64 %29, align 1
|
||||
%31 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.CStrCopy"(ptr %30, %"github.com/goplus/llgo/runtime/internal/runtime.String" %26)
|
||||
store ptr %31, ptr %27, align 8
|
||||
%32 = add i64 %18, 1
|
||||
%18 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %6, 0
|
||||
%19 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %6, 1
|
||||
%20 = icmp slt i64 %16, 0
|
||||
%21 = icmp sge i64 %16, %19
|
||||
%22 = or i1 %21, %20
|
||||
call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %22)
|
||||
%23 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %18, i64 %16
|
||||
%24 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %23, align 8
|
||||
%25 = getelementptr ptr, ptr %9, i64 %16
|
||||
%26 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.String" %24, 1
|
||||
%27 = add i64 %26, 1
|
||||
%28 = alloca i8, i64 %27, align 1
|
||||
%29 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.CStrCopy"(ptr %28, %"github.com/goplus/llgo/runtime/internal/runtime.String" %24)
|
||||
store ptr %29, ptr %25, align 8
|
||||
%30 = add i64 %16, 1
|
||||
br label %_llgo_4
|
||||
|
||||
_llgo_6: ; preds = %_llgo_4
|
||||
%33 = getelementptr ptr, ptr %11, i64 %9
|
||||
store ptr null, ptr %33, align 8
|
||||
%31 = getelementptr ptr, ptr %9, i64 %7
|
||||
store ptr null, ptr %31, align 8
|
||||
br label %_llgo_1
|
||||
}
|
||||
|
||||
declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"()
|
||||
|
||||
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64)
|
||||
|
||||
declare void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1)
|
||||
|
||||
@@ -1,50 +1,44 @@
|
||||
; ModuleID = 'main'
|
||||
source_filename = "main"
|
||||
; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testlibc/argv'
|
||||
source_filename = "github.com/goplus/llgo/compiler/cl/_testlibc/argv"
|
||||
|
||||
@"main.init$guard" = global i1 false, align 1
|
||||
@__llgo_argc = global i32 0, align 4
|
||||
@__llgo_argv = global ptr null, align 8
|
||||
@"github.com/goplus/llgo/compiler/cl/_testlibc/argv.init$guard" = global i1 false, align 1
|
||||
@__llgo_argc = external global i32, align 4
|
||||
@0 = private unnamed_addr constant [4 x i8] c"%s\0A\00", align 1
|
||||
@__llgo_argv = external global ptr, align 8
|
||||
|
||||
define void @main.init() {
|
||||
define void @"github.com/goplus/llgo/compiler/cl/_testlibc/argv.init"() {
|
||||
_llgo_0:
|
||||
%0 = load i1, ptr @"main.init$guard", align 1
|
||||
%0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/argv.init$guard", align 1
|
||||
br i1 %0, label %_llgo_2, label %_llgo_1
|
||||
|
||||
_llgo_1: ; preds = %_llgo_0
|
||||
store i1 true, ptr @"main.init$guard", align 1
|
||||
store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/argv.init$guard", align 1
|
||||
br label %_llgo_2
|
||||
|
||||
_llgo_2: ; preds = %_llgo_1, %_llgo_0
|
||||
ret void
|
||||
}
|
||||
|
||||
define i32 @main(i32 %0, ptr %1) {
|
||||
define void @"github.com/goplus/llgo/compiler/cl/_testlibc/argv.main"() {
|
||||
_llgo_0:
|
||||
store i32 %0, ptr @__llgo_argc, align 4
|
||||
store ptr %1, ptr @__llgo_argv, align 8
|
||||
call void @"github.com/goplus/llgo/runtime/internal/runtime.init"()
|
||||
call void @main.init()
|
||||
br label %_llgo_1
|
||||
|
||||
_llgo_1: ; preds = %_llgo_2, %_llgo_0
|
||||
%2 = phi i32 [ 0, %_llgo_0 ], [ %9, %_llgo_2 ]
|
||||
%3 = load i32, ptr @__llgo_argc, align 4
|
||||
%4 = icmp slt i32 %2, %3
|
||||
br i1 %4, label %_llgo_2, label %_llgo_3
|
||||
%0 = phi i32 [ 0, %_llgo_0 ], [ %7, %_llgo_2 ]
|
||||
%1 = load i32, ptr @__llgo_argc, align 4
|
||||
%2 = icmp slt i32 %0, %1
|
||||
br i1 %2, label %_llgo_2, label %_llgo_3
|
||||
|
||||
_llgo_2: ; preds = %_llgo_1
|
||||
%5 = load ptr, ptr @__llgo_argv, align 8
|
||||
%6 = getelementptr ptr, ptr %5, i32 %2
|
||||
%7 = load ptr, ptr %6, align 8
|
||||
%8 = call i32 (ptr, ...) @printf(ptr @0, ptr %7)
|
||||
%9 = add i32 %2, 1
|
||||
%3 = load ptr, ptr @__llgo_argv, align 8
|
||||
%4 = getelementptr ptr, ptr %3, i32 %0
|
||||
%5 = load ptr, ptr %4, align 8
|
||||
%6 = call i32 (ptr, ...) @printf(ptr @0, ptr %5)
|
||||
%7 = add i32 %0, 1
|
||||
br label %_llgo_1
|
||||
|
||||
_llgo_3: ; preds = %_llgo_1
|
||||
ret i32 0
|
||||
ret void
|
||||
}
|
||||
|
||||
declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"()
|
||||
|
||||
declare i32 @printf(ptr, ...)
|
||||
|
||||
@@ -1,59 +1,51 @@
|
||||
; ModuleID = 'main'
|
||||
source_filename = "main"
|
||||
; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testlibc/atomic'
|
||||
source_filename = "github.com/goplus/llgo/compiler/cl/_testlibc/atomic"
|
||||
|
||||
@"main.init$guard" = global i1 false, align 1
|
||||
@__llgo_argc = global i32 0, align 4
|
||||
@__llgo_argv = global ptr null, align 8
|
||||
@"github.com/goplus/llgo/compiler/cl/_testlibc/atomic.init$guard" = global i1 false, align 1
|
||||
@0 = private unnamed_addr constant [12 x i8] c"store: %ld\0A\00", align 1
|
||||
@1 = private unnamed_addr constant [18 x i8] c"ret: %ld, v: %ld\0A\00", align 1
|
||||
@2 = private unnamed_addr constant [25 x i8] c"ret: %ld vs 100, v: %ld\0A\00", align 1
|
||||
@3 = private unnamed_addr constant [25 x i8] c"ret: %ld vs 101, v: %ld\0A\00", align 1
|
||||
@4 = private unnamed_addr constant [18 x i8] c"ret: %ld, v: %ld\0A\00", align 1
|
||||
|
||||
define void @main.init() {
|
||||
define void @"github.com/goplus/llgo/compiler/cl/_testlibc/atomic.init"() {
|
||||
_llgo_0:
|
||||
%0 = load i1, ptr @"main.init$guard", align 1
|
||||
%0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/atomic.init$guard", align 1
|
||||
br i1 %0, label %_llgo_2, label %_llgo_1
|
||||
|
||||
_llgo_1: ; preds = %_llgo_0
|
||||
store i1 true, ptr @"main.init$guard", align 1
|
||||
store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/atomic.init$guard", align 1
|
||||
br label %_llgo_2
|
||||
|
||||
_llgo_2: ; preds = %_llgo_1, %_llgo_0
|
||||
ret void
|
||||
}
|
||||
|
||||
define i32 @main(i32 %0, ptr %1) {
|
||||
define void @"github.com/goplus/llgo/compiler/cl/_testlibc/atomic.main"() {
|
||||
_llgo_0:
|
||||
store i32 %0, ptr @__llgo_argc, align 4
|
||||
store ptr %1, ptr @__llgo_argv, align 8
|
||||
call void @"github.com/goplus/llgo/runtime/internal/runtime.init"()
|
||||
call void @main.init()
|
||||
%2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8)
|
||||
store atomic i64 100, ptr %2 seq_cst, align 4
|
||||
%3 = load atomic i64, ptr %2 seq_cst, align 4
|
||||
%4 = call i32 (ptr, ...) @printf(ptr @0, i64 %3)
|
||||
%5 = atomicrmw add ptr %2, i64 1 seq_cst, align 8
|
||||
%6 = load i64, ptr %2, align 4
|
||||
%7 = call i32 (ptr, ...) @printf(ptr @1, i64 %5, i64 %6)
|
||||
%8 = cmpxchg ptr %2, i64 100, i64 102 seq_cst seq_cst, align 8
|
||||
%9 = extractvalue { i64, i1 } %8, 0
|
||||
%10 = extractvalue { i64, i1 } %8, 1
|
||||
%11 = load i64, ptr %2, align 4
|
||||
%12 = call i32 (ptr, ...) @printf(ptr @2, i64 %9, i64 %11)
|
||||
%13 = cmpxchg ptr %2, i64 101, i64 102 seq_cst seq_cst, align 8
|
||||
%14 = extractvalue { i64, i1 } %13, 0
|
||||
%15 = extractvalue { i64, i1 } %13, 1
|
||||
%16 = load i64, ptr %2, align 4
|
||||
%17 = call i32 (ptr, ...) @printf(ptr @3, i64 %14, i64 %16)
|
||||
%18 = atomicrmw sub ptr %2, i64 1 seq_cst, align 8
|
||||
%19 = load i64, ptr %2, align 4
|
||||
%20 = call i32 (ptr, ...) @printf(ptr @4, i64 %18, i64 %19)
|
||||
ret i32 0
|
||||
%0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 8)
|
||||
store atomic i64 100, ptr %0 seq_cst, align 4
|
||||
%1 = load atomic i64, ptr %0 seq_cst, align 4
|
||||
%2 = call i32 (ptr, ...) @printf(ptr @0, i64 %1)
|
||||
%3 = atomicrmw add ptr %0, i64 1 seq_cst, align 8
|
||||
%4 = load i64, ptr %0, align 4
|
||||
%5 = call i32 (ptr, ...) @printf(ptr @1, i64 %3, i64 %4)
|
||||
%6 = cmpxchg ptr %0, i64 100, i64 102 seq_cst seq_cst, align 8
|
||||
%7 = extractvalue { i64, i1 } %6, 0
|
||||
%8 = extractvalue { i64, i1 } %6, 1
|
||||
%9 = load i64, ptr %0, align 4
|
||||
%10 = call i32 (ptr, ...) @printf(ptr @2, i64 %7, i64 %9)
|
||||
%11 = cmpxchg ptr %0, i64 101, i64 102 seq_cst seq_cst, align 8
|
||||
%12 = extractvalue { i64, i1 } %11, 0
|
||||
%13 = extractvalue { i64, i1 } %11, 1
|
||||
%14 = load i64, ptr %0, align 4
|
||||
%15 = call i32 (ptr, ...) @printf(ptr @3, i64 %12, i64 %14)
|
||||
%16 = atomicrmw sub ptr %0, i64 1 seq_cst, align 8
|
||||
%17 = load i64, ptr %0, align 4
|
||||
%18 = call i32 (ptr, ...) @printf(ptr @4, i64 %16, i64 %17)
|
||||
ret void
|
||||
}
|
||||
|
||||
declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"()
|
||||
|
||||
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64)
|
||||
|
||||
declare i32 @printf(ptr, ...)
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
; ModuleID = 'main'
|
||||
source_filename = "main"
|
||||
; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testlibc/complex'
|
||||
source_filename = "github.com/goplus/llgo/compiler/cl/_testlibc/complex"
|
||||
|
||||
%"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 }
|
||||
|
||||
@"main.init$guard" = global i1 false, align 1
|
||||
@"github.com/goplus/llgo/compiler/cl/_testlibc/complex.init$guard" = global i1 false, align 1
|
||||
@0 = private unnamed_addr constant [5 x i8] c"addr:", align 1
|
||||
@1 = private unnamed_addr constant [10 x i8] c"abs(3+4i):", align 1
|
||||
@2 = private unnamed_addr constant [11 x i8] c"real(3+4i):", align 1
|
||||
@3 = private unnamed_addr constant [11 x i8] c"imag(3+4i):", align 1
|
||||
@__llgo_argc = global i32 0, align 4
|
||||
@__llgo_argv = global ptr null, align 8
|
||||
|
||||
define void @main.f({ float, float } %0, { float, float } %1, ptr %2) {
|
||||
define void @"github.com/goplus/llgo/compiler/cl/_testlibc/complex.f"({ float, float } %0, { float, float } %1, ptr %2) {
|
||||
_llgo_0:
|
||||
call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 5 })
|
||||
call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32)
|
||||
@@ -38,27 +36,23 @@ _llgo_0:
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @main.init() {
|
||||
define void @"github.com/goplus/llgo/compiler/cl/_testlibc/complex.init"() {
|
||||
_llgo_0:
|
||||
%0 = load i1, ptr @"main.init$guard", align 1
|
||||
%0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/complex.init$guard", align 1
|
||||
br i1 %0, label %_llgo_2, label %_llgo_1
|
||||
|
||||
_llgo_1: ; preds = %_llgo_0
|
||||
store i1 true, ptr @"main.init$guard", align 1
|
||||
store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/complex.init$guard", align 1
|
||||
br label %_llgo_2
|
||||
|
||||
_llgo_2: ; preds = %_llgo_1, %_llgo_0
|
||||
ret void
|
||||
}
|
||||
|
||||
define i32 @main(i32 %0, ptr %1) {
|
||||
define void @"github.com/goplus/llgo/compiler/cl/_testlibc/complex.main"() {
|
||||
_llgo_0:
|
||||
store i32 %0, ptr @__llgo_argc, align 4
|
||||
store ptr %1, ptr @__llgo_argv, align 8
|
||||
call void @"github.com/goplus/llgo/runtime/internal/runtime.init"()
|
||||
call void @main.init()
|
||||
call void @main.f({ float, float } { float 3.000000e+00, float 4.000000e+00 }, { float, float } { float 3.000000e+00, float 4.000000e+00 }, ptr @main.f)
|
||||
ret i32 0
|
||||
call void @"github.com/goplus/llgo/compiler/cl/_testlibc/complex.f"({ float, float } { float 3.000000e+00, float 4.000000e+00 }, { float, float } { float 3.000000e+00, float 4.000000e+00 }, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/complex.f")
|
||||
ret void
|
||||
}
|
||||
|
||||
declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String")
|
||||
@@ -70,5 +64,3 @@ declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintPointer"(ptr
|
||||
declare float @cabsf({ float, float })
|
||||
|
||||
declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double)
|
||||
|
||||
declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"()
|
||||
|
||||
@@ -1,44 +1,38 @@
|
||||
; ModuleID = 'main'
|
||||
source_filename = "main"
|
||||
; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testlibc/demangle'
|
||||
source_filename = "github.com/goplus/llgo/compiler/cl/_testlibc/demangle"
|
||||
|
||||
%"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 }
|
||||
|
||||
@"main.init$guard" = global i1 false, align 1
|
||||
@__llgo_argc = global i32 0, align 4
|
||||
@__llgo_argv = global ptr null, align 8
|
||||
@"github.com/goplus/llgo/compiler/cl/_testlibc/demangle.init$guard" = global i1 false, align 1
|
||||
@0 = private unnamed_addr constant [29 x i8] c"__ZNK9INIReader10ParseErrorEv", align 1
|
||||
@1 = private unnamed_addr constant [4 x i8] c"%s\0A\00", align 1
|
||||
@2 = private unnamed_addr constant [18 x i8] c"Failed to demangle", align 1
|
||||
|
||||
define void @main.init() {
|
||||
define void @"github.com/goplus/llgo/compiler/cl/_testlibc/demangle.init"() {
|
||||
_llgo_0:
|
||||
%0 = load i1, ptr @"main.init$guard", align 1
|
||||
%0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/demangle.init$guard", align 1
|
||||
br i1 %0, label %_llgo_2, label %_llgo_1
|
||||
|
||||
_llgo_1: ; preds = %_llgo_0
|
||||
store i1 true, ptr @"main.init$guard", align 1
|
||||
store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/demangle.init$guard", align 1
|
||||
br label %_llgo_2
|
||||
|
||||
_llgo_2: ; preds = %_llgo_1, %_llgo_0
|
||||
ret void
|
||||
}
|
||||
|
||||
define i32 @main(i32 %0, ptr %1) {
|
||||
define void @"github.com/goplus/llgo/compiler/cl/_testlibc/demangle.main"() {
|
||||
_llgo_0:
|
||||
store i32 %0, ptr @__llgo_argc, align 4
|
||||
store ptr %1, ptr @__llgo_argv, align 8
|
||||
call void @"github.com/goplus/llgo/runtime/internal/runtime.init"()
|
||||
call void @main.init()
|
||||
%2 = call ptr @_ZN4llvm15itaniumDemangleENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEEb(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 29 }, i1 true)
|
||||
%3 = icmp ne ptr %2, null
|
||||
br i1 %3, label %_llgo_1, label %_llgo_3
|
||||
%0 = call ptr @_ZN4llvm15itaniumDemangleENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEEb(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 29 }, i1 true)
|
||||
%1 = icmp ne ptr %0, null
|
||||
br i1 %1, label %_llgo_1, label %_llgo_3
|
||||
|
||||
_llgo_1: ; preds = %_llgo_0
|
||||
%4 = call i32 (ptr, ...) @printf(ptr @1, ptr %2)
|
||||
%2 = call i32 (ptr, ...) @printf(ptr @1, ptr %0)
|
||||
br label %_llgo_2
|
||||
|
||||
_llgo_2: ; preds = %_llgo_3, %_llgo_1
|
||||
ret i32 0
|
||||
ret void
|
||||
|
||||
_llgo_3: ; preds = %_llgo_0
|
||||
call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 18 })
|
||||
@@ -46,8 +40,6 @@ _llgo_3: ; preds = %_llgo_0
|
||||
br label %_llgo_2
|
||||
}
|
||||
|
||||
declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"()
|
||||
|
||||
declare ptr @_ZN4llvm15itaniumDemangleENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEEb(%"github.com/goplus/llgo/runtime/internal/runtime.String", i1)
|
||||
|
||||
declare i32 @printf(ptr, ...)
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
; ModuleID = 'main'
|
||||
source_filename = "main"
|
||||
; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testlibc/sqlite'
|
||||
source_filename = "github.com/goplus/llgo/compiler/cl/_testlibc/sqlite"
|
||||
|
||||
@"main.init$guard" = global i1 false, align 1
|
||||
@"github.com/goplus/llgo/compiler/cl/_testlibc/sqlite.init$guard" = global i1 false, align 1
|
||||
@0 = private unnamed_addr constant [20 x i8] c"==> Error: (%d) %s\0A\00", align 1
|
||||
@__llgo_argc = global i32 0, align 4
|
||||
@__llgo_argv = global ptr null, align 8
|
||||
@1 = private unnamed_addr constant [9 x i8] c":memory:\00", align 1
|
||||
|
||||
define void @main.check(i32 %0) {
|
||||
define void @"github.com/goplus/llgo/compiler/cl/_testlibc/sqlite.check"(i32 %0) {
|
||||
_llgo_0:
|
||||
%1 = icmp ne i32 %0, 0
|
||||
br i1 %1, label %_llgo_1, label %_llgo_2
|
||||
@@ -22,31 +20,27 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @main.init() {
|
||||
define void @"github.com/goplus/llgo/compiler/cl/_testlibc/sqlite.init"() {
|
||||
_llgo_0:
|
||||
%0 = load i1, ptr @"main.init$guard", align 1
|
||||
%0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/sqlite.init$guard", align 1
|
||||
br i1 %0, label %_llgo_2, label %_llgo_1
|
||||
|
||||
_llgo_1: ; preds = %_llgo_0
|
||||
store i1 true, ptr @"main.init$guard", align 1
|
||||
store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testlibc/sqlite.init$guard", align 1
|
||||
br label %_llgo_2
|
||||
|
||||
_llgo_2: ; preds = %_llgo_1, %_llgo_0
|
||||
ret void
|
||||
}
|
||||
|
||||
define i32 @main(i32 %0, ptr %1) {
|
||||
define void @"github.com/goplus/llgo/compiler/cl/_testlibc/sqlite.main"() {
|
||||
_llgo_0:
|
||||
store i32 %0, ptr @__llgo_argc, align 4
|
||||
store ptr %1, ptr @__llgo_argv, align 8
|
||||
call void @"github.com/goplus/llgo/runtime/internal/runtime.init"()
|
||||
call void @main.init()
|
||||
%2 = call { ptr, i32 } @"github.com/goplus/llgo/c/sqlite.OpenV2"(ptr @1, i32 130, ptr null)
|
||||
%3 = extractvalue { ptr, i32 } %2, 0
|
||||
%4 = extractvalue { ptr, i32 } %2, 1
|
||||
call void @main.check(i32 %4)
|
||||
%5 = call i32 @sqlite3_close(ptr %3)
|
||||
ret i32 0
|
||||
%0 = call { ptr, i32 } @"github.com/goplus/llgo/c/sqlite.OpenV2"(ptr @1, i32 130, ptr null)
|
||||
%1 = extractvalue { ptr, i32 } %0, 0
|
||||
%2 = extractvalue { ptr, i32 } %0, 1
|
||||
call void @"github.com/goplus/llgo/compiler/cl/_testlibc/sqlite.check"(i32 %2)
|
||||
%3 = call i32 @sqlite3_close(ptr %1)
|
||||
ret void
|
||||
}
|
||||
|
||||
declare ptr @sqlite3_errstr(i32)
|
||||
@@ -55,8 +49,6 @@ declare i32 @printf(ptr, ...)
|
||||
|
||||
declare void @exit(i32)
|
||||
|
||||
declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"()
|
||||
|
||||
declare { ptr, i32 } @"github.com/goplus/llgo/c/sqlite.OpenV2"(ptr, i32, ptr)
|
||||
|
||||
declare i32 @sqlite3_close(ptr)
|
||||
|
||||
Reference in New Issue
Block a user