]> Cypherpunks repositories - gostls13.git/commitdiff
test/codegen: fix failing condmove wasm tests
authorMichael Munday <mndygolang+git@gmail.com>
Sat, 26 Jul 2025 23:17:49 +0000 (00:17 +0100)
committerMichael Knyszek <mknyszek@google.com>
Mon, 28 Jul 2025 18:01:53 +0000 (11:01 -0700)
These recently added tests failed when using the -all_codgen flag.

Fixes #74770

Change-Id: Idea1ea02af2bd9f45c7d0a28d633c7442328e6df
Reviewed-on: https://go-review.googlesource.com/c/go/+/690715
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Run-TryBot: Michael Munday <mikemndy@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Mark Freeman <mark@golang.org>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
TryBot-Bypass: Michael Knyszek <mknyszek@google.com>

test/codegen/condmove.go

index 5659972eed1c4dee3fa13e0bf8933eec4a1b6682..97be0ced75d19da636c9c747f747d39465a5fcb1 100644 (file)
@@ -459,7 +459,7 @@ func cmovmathadd(a uint, b bool) uint {
        // amd64:"ADDQ", -"CMOV"
        // arm64:"CSINC", -"CSEL"
        // ppc64x:"ADD", -"ISEL"
-       // wasm:"Add", "-Select"
+       // wasm:"I64Add", -"Select"
        return a
 }
 
@@ -470,7 +470,7 @@ func cmovmathsub(a uint, b bool) uint {
        // amd64:"SUBQ", -"CMOV"
        // arm64:"SUB", -"CSEL"
        // ppc64x:"SUB", -"ISEL"
-       // wasm:"Sub", "-Select"
+       // wasm:"I64Sub", -"Select"
        return a
 }
 
@@ -481,18 +481,19 @@ func cmovmathdouble(a uint, b bool) uint {
        // amd64:"SHL", -"CMOV"
        // amd64/v3:"SHL", -"CMOV", -"MOV"
        // arm64:"LSL", -"CSEL"
-       // wasm:"Shl", "-Select"
+       // wasm:"I64Shl", -"Select"
        return a
 }
 
 func cmovmathhalvei(a int, b bool) int {
        if b {
-               // For some reason on arm64 it attributes the ASR to inside this block rather than where the Phi node is.
+               // For some reason the compiler attributes the shift to inside this block rather than where the Phi node is.
                // arm64:"ASR", -"CSEL"
+               // wasm:"I64ShrS", -"Select"
                a /= 2
        }
        // arm64:-"CSEL"
-       // wasm:"Shr", "-Select"
+       // wasm:-"Select"
        return a
 }
 
@@ -503,6 +504,6 @@ func cmovmathhalveu(a uint, b bool) uint {
        // amd64:"SHR", -"CMOV"
        // amd64/v3:"SHR", -"CMOV", -"MOV"
        // arm64:"LSR", -"CSEL"
-       // wasm:"Shr", "-Select"
+       // wasm:"I64ShrU", -"Select"
        return a
 }