Fix linker errors for runtime.vgetrandom and crypto/internal/sysrand.fatal

This commit is contained in:
Ben Krieger
2025-09-18 23:46:46 -04:00
committed by Ron Evans
parent 93a11e266f
commit 821f2aeae0
2 changed files with 20 additions and 0 deletions
+9
View File
@@ -4,6 +4,8 @@ package os_smoke_test
// Intended to catch build tag mistakes affecting bare metal targets.
import (
"crypto/rand"
"crypto/rsa"
"fmt"
"path/filepath"
"testing"
@@ -25,3 +27,10 @@ func TestFmt(t *testing.T) {
t.Errorf("printf returned %d, expected 14", n)
}
}
// Regression test for https://github.com/tinygo-org/tinygo/issues/4921
func TestRand(t *testing.T) {
if _, err := rsa.GenerateKey(rand.Reader, 2048); err != nil {
t.Error(err)
}
}