cl: clean test
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package main
|
||||
|
||||
import "github.com/goplus/llgo/compiler/cl/internal/stdio"
|
||||
import "github.com/goplus/llgo/compiler/cl/_testdata/importpkg/stdio"
|
||||
|
||||
var hello = [...]int8{'H', 'e', 'l', 'l', 'o', '\n', 0}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ _llgo_0:
|
||||
|
||||
_llgo_1: ; preds = %_llgo_0
|
||||
store i1 true, ptr @"main.init$guard", align 1
|
||||
call void @"github.com/goplus/llgo/compiler/cl/internal/stdio.init"()
|
||||
call void @"github.com/goplus/llgo/compiler/cl/_testdata/importpkg/stdio.init"()
|
||||
store i8 72, ptr @main.hello, align 1
|
||||
store i8 101, ptr getelementptr inbounds (i8, ptr @main.hello, i64 1), align 1
|
||||
store i8 108, ptr getelementptr inbounds (i8, ptr @main.hello, i64 2), align 1
|
||||
@@ -33,15 +33,15 @@ _llgo_0:
|
||||
store ptr %1, ptr @__llgo_argv, align 8
|
||||
call void @"github.com/goplus/llgo/runtime/internal/runtime.init"()
|
||||
call void @main.init()
|
||||
%2 = call i64 @"github.com/goplus/llgo/compiler/cl/internal/stdio.Max"(i64 2, i64 100)
|
||||
%2 = call i64 @"github.com/goplus/llgo/compiler/cl/_testdata/importpkg/stdio.Max"(i64 2, i64 100)
|
||||
call void (ptr, ...) @printf(ptr @main.hello)
|
||||
ret i32 0
|
||||
}
|
||||
|
||||
declare void @"github.com/goplus/llgo/compiler/cl/internal/stdio.init"()
|
||||
declare void @"github.com/goplus/llgo/compiler/cl/_testdata/importpkg/stdio.init"()
|
||||
|
||||
declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"()
|
||||
|
||||
declare i64 @"github.com/goplus/llgo/compiler/cl/internal/stdio.Max"(i64, i64)
|
||||
declare i64 @"github.com/goplus/llgo/compiler/cl/_testdata/importpkg/stdio.Max"(i64, i64)
|
||||
|
||||
declare void @printf(ptr, ...)
|
||||
|
||||
17
compiler/cl/_testdata/importpkg/stdio/printf.go
Normal file
17
compiler/cl/_testdata/importpkg/stdio/printf.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package stdio
|
||||
|
||||
import _ "unsafe"
|
||||
|
||||
const (
|
||||
LLGoPackage = true
|
||||
)
|
||||
|
||||
//go:linkname Printf C.printf
|
||||
func Printf(format *int8, __llgo_va_list ...any)
|
||||
|
||||
func Max(a, b int) int {
|
||||
if a > b {
|
||||
return a
|
||||
}
|
||||
return b
|
||||
}
|
||||
Reference in New Issue
Block a user