interp: support big-endian targets

The interp package was assuming that all targets were little-endian. But
that's not true: we now have a big-endian target (GOARCH=mips).

This fixes the interp package to use the appropriate byte order for a
given target.
This commit is contained in:
Ayke van Laethem
2024-08-22 16:42:03 +02:00
committed by Ron Evans
parent 25abfff632
commit 73f519b589
5 changed files with 110 additions and 85 deletions
+5 -1
View File
@@ -181,9 +181,13 @@ func TestBuild(t *testing.T) {
// Run a single test for GOARCH=mips to see whether it works at all.
// Big-endian MIPS isn't fully supported yet, but simple examples
// should work.
// Once big-endian is fully supported, we can probably flip this
// around and do full testing of MIPS big-endian support and only do
// limited testing of MIPS little-endian (because the two are some
// similar).
t.Parallel()
options := optionsFromOSARCH("linux/mips/softfloat", sema)
runTest("alias.go", options, t, nil, nil)
runTest("map.go", options, t, nil, nil)
})
t.Run("WebAssembly", func(t *testing.T) {
t.Parallel()