`,
pos: []string{"\tANDQ\t\\$4095,"},
},
- {
- // Test that small memmove was replaced with direct movs
- fn: `
- func $() {
- x := [...]byte{1, 2, 3, 4, 5, 6, 7}
- copy(x[1:], x[:])
- }
- `,
- neg: []string{"memmove"},
- },
- {
- // Same as above but with different size
- fn: `
- func $() {
- x := [...]byte{1, 2, 3, 4}
- copy(x[1:], x[:])
- }
- `,
- neg: []string{"memmove"},
- },
- {
- // Same as above but with different size
- fn: `
- func $() {
- x := [...]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}
- copy(x[1:], x[:])
- }
- `,
- neg: []string{"memmove"},
- },
{
fn: `
func $(p int, q *int) bool {
`,
pos: []string{"\tANDL\t\\$4095,"},
},
- {
- // Test that small memmove was replaced with direct movs
- fn: `
- func $() {
- x := [...]byte{1, 2, 3, 4, 5, 6, 7}
- copy(x[1:], x[:])
- }
- `,
- neg: []string{"memmove"},
- },
- {
- // Same as above but with different size
- fn: `
- func $() {
- x := [...]byte{1, 2, 3, 4}
- copy(x[1:], x[:])
- }
- `,
- neg: []string{"memmove"},
- },
}
var linuxS390XTests = []*asmTest{
package codegen
-func movesmall() {
+// These tests check that memmoves calls on small data are replaced
+// with MOVs
+
+func movesmall4() {
+ x := [...]byte{1, 2, 3, 4}
+ // 386:-".*memmove"
+ // amd64:-".*memmove"
+ // arm:-".*memmove"
+ // arm64:-".*memmove"
+ copy(x[1:], x[:])
+}
+
+func movesmall7() {
x := [...]byte{1, 2, 3, 4, 5, 6, 7}
- copy(x[1:], x[:]) // arm64:-".*memmove"
+ // 386:-".*memmove"
+ // amd64:-".*memmove"
+ // arm64:-".*memmove"
+ copy(x[1:], x[:])
+}
+
+func movesmall16() {
+ x := [...]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}
+ // amd64:-".*memmove"
+ copy(x[1:], x[:])
}