]> Cypherpunks repositories - gostls13.git/commitdiff
test/codegen: port tbz/tbnz arm64 tests
authorAlberto Donizetti <alb.donizetti@gmail.com>
Fri, 23 Mar 2018 17:50:39 +0000 (18:50 +0100)
committerAlberto Donizetti <alb.donizetti@gmail.com>
Sat, 24 Mar 2018 09:35:53 +0000 (09:35 +0000)
And delete them from asm_test.

Change-Id: I34fcf85ae8ce09cd146fe4ce6a0ae7616bd97e2d
Reviewed-on: https://go-review.googlesource.com/102296
Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Giovanni Bajo <rasky@develer.com>
src/cmd/compile/internal/gc/asm_test.go
test/codegen/comparisons.go

index 852f8e3a17cb2fdccb335bb6680fcf7f36465706..0fe3d31734af51fd032f883eabb8997bfab5cf38 100644 (file)
@@ -481,46 +481,6 @@ var linuxARM64Tests = []*asmTest{
                pos: []string{"LSL\t\\$17"},
                neg: []string{"CMP"},
        },
-       {
-               fn: `
-               func $(a int32, ptr *int) {
-                       if a >= 0 {
-                               *ptr = 0
-                       }
-               }
-               `,
-               pos: []string{"TBNZ"},
-       },
-       {
-               fn: `
-               func $(a int64, ptr *int) {
-                       if a >= 0 {
-                               *ptr = 0
-                       }
-               }
-               `,
-               pos: []string{"TBNZ"},
-       },
-       {
-               fn: `
-               func $(a int32, ptr *int) {
-                       if a < 0 {
-                               *ptr = 0
-                       }
-               }
-               `,
-               pos: []string{"TBZ"},
-       },
-       {
-               fn: `
-               func $(a int64, ptr *int) {
-                       if a < 0 {
-                               *ptr = 0
-                       }
-               }
-               `,
-               pos: []string{"TBZ"},
-       },
        // Load-combining tests.
        {
                fn: `
index c0824e6ed16c6f9d2a50f6d518f41e6427cdb55b..15a659a4e6a993fa5014fc938207a16a1a84b6ab 100644 (file)
@@ -106,3 +106,29 @@ func CmpMem5(p **int) {
        // amd64:`CMPL\truntime.writeBarrier\(SB\), [$]0`
        *p = nil
 }
+
+// Check tbz/tbnz are generated when comparing against zero on arm64
+
+func CmpZero1(a int32, ptr *int) {
+       if a < 0 { // arm64:"TBZ"
+               *ptr = 0
+       }
+}
+
+func CmpZero2(a int64, ptr *int) {
+       if a < 0 { // arm64:"TBZ"
+               *ptr = 0
+       }
+}
+
+func CmpZero3(a int32, ptr *int) {
+       if a >= 0 { // arm64:"TBNZ"
+               *ptr = 0
+       }
+}
+
+func CmpZero4(a int64, ptr *int) {
+       if a >= 0 { // arm64:"TBNZ"
+               *ptr = 0
+       }
+}