Skip to content

big.NewInt build failed #1449

@nobonobo

Description

@nobonobo

bigint-issue.go

package main

import "math/big"

var bigZero = big.NewInt(0)

func main() {}
$ tinygo build -o main ./bigint-issue.go 
# command-line-arguments
/usr/local/Cellar/go/1.15.2/libexec/src/math/big/nat.go:74:11: interp: unknown GEP

traceback:
/usr/local/Cellar/go/1.15.2/libexec/src/math/big/nat.go:74:11:
 %16 = getelementptr inbounds i64, i64* %4, i64 0, !dbg !1658
/usr/local/Cellar/go/1.15.2/libexec/src/math/big/nat.go:84:19:
 %7 = call { i64*, i64, i64 } @"(math/big.nat).setWord"(i64* %4, i64 %5, i64 %6, i64 %x, i8* undef, i8* undef), !dbg !1663
/usr/local/Cellar/go/1.15.2/libexec/src/math/big/int.go:55:25:
 %17 = call { i64*, i64, i64 } @"(math/big.nat).setUint64"(i64* %14, i64 %15, i64 %16, i64 %2, i8* undef, i8* undef), !dbg !1671
/usr/local/Cellar/go/1.15.2/libexec/src/math/big/int.go:69:26:
 %2 = call %"math/big.Int"* @"(*math/big.Int).SetInt64"(%"math/big.Int"* %0, i64 %x, i8* undef, i8* undef), !dbg !1655
command-line-arguments/<init>:9:25:
 %0 = call %"math/big.Int"* @"math/big.NewInt"(i64 0, i8* undef, i8* undef), !dbg !1650

Other Info.

$ go version
go version go1.15.2 darwin/amd64
$ tinygo version
tinygo version 0.15.0 darwin/amd64 (using go version go1.15.2 and LLVM version 10.0.1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions