merge upstream
This commit is contained in:
@@ -25,7 +25,7 @@ func main() {
|
||||
data = append(data, "def"...)
|
||||
println(data)
|
||||
var i any = 100
|
||||
println(true, 100, -100, uint(255), int32(-100), 100.5, i, &i, uintptr(unsafe.Pointer(&i)))
|
||||
println(true, 0, 100, -100, uint(255), int32(-100), 0.0, 100.5, i, &i, uintptr(unsafe.Pointer(&i)))
|
||||
var dst [3]byte
|
||||
n := copy(dst[:], data)
|
||||
println(n, dst[0], dst[1], dst[2])
|
||||
|
||||
@@ -248,6 +248,8 @@ _llgo_0:
|
||||
%111 = ptrtoint ptr %107 to i64
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintBool"(i1 true)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 32)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintInt"(i64 0)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 32)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintInt"(i64 100)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 32)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintInt"(i64 -100)
|
||||
@@ -256,6 +258,8 @@ _llgo_0:
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 32)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintInt"(i64 -100)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 32)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintFloat"(double 0.000000e+00)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 32)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintFloat"(double 1.005000e+02)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintByte"(i8 32)
|
||||
call void @"github.com/goplus/llgo/internal/runtime.PrintIface"(%"github.com/goplus/llgo/internal/runtime.iface" %110)
|
||||
|
||||
Binary file not shown.
@@ -23,19 +23,19 @@ func PrintBool(v bool) {
|
||||
}
|
||||
|
||||
func PrintFloat(v float64) {
|
||||
switch { // TODO(xsw): does c.Fprintf support these special cases?
|
||||
switch {
|
||||
case v != v:
|
||||
c.Fprintf(c.Stderr, c.Str("NaN"))
|
||||
return
|
||||
case v+v == v:
|
||||
case v+v == v && v != 0:
|
||||
if v > 0 {
|
||||
c.Fprintf(c.Stderr, c.Str("+Inf"))
|
||||
} else if v < 0 {
|
||||
} else {
|
||||
c.Fprintf(c.Stderr, c.Str("-Inf"))
|
||||
}
|
||||
return
|
||||
}
|
||||
c.Fprintf(c.Stderr, c.Str("%g"), v)
|
||||
c.Fprintf(c.Stderr, c.Str("%e"), v)
|
||||
}
|
||||
|
||||
// func PrintComplex(c complex128) {
|
||||
|
||||
Reference in New Issue
Block a user