diff --git a/tests/legacy/examples/lib/BUILD.bazel b/tests/legacy/examples/lib/BUILD.bazel index d12aa76d19..cbc89b4172 100644 --- a/tests/legacy/examples/lib/BUILD.bazel +++ b/tests/legacy/examples/lib/BUILD.bazel @@ -7,10 +7,12 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = [ - "add.s", + "add_amd64.s", + "add_arm64.s", "asm.go", "lib.go", - "sub.s", + "sub_amd64.s", + "sub_arm64.s", ], importpath = "github.com/bazelbuild/rules_go/examples/lib", deps = ["//tests/legacy/examples/lib/deep:go_default_library"], diff --git a/tests/legacy/examples/lib/add.s b/tests/legacy/examples/lib/add_amd64.s similarity index 100% rename from tests/legacy/examples/lib/add.s rename to tests/legacy/examples/lib/add_amd64.s diff --git a/tests/legacy/examples/lib/add_arm64.s b/tests/legacy/examples/lib/add_arm64.s new file mode 100644 index 0000000000..7ade97d339 --- /dev/null +++ b/tests/legacy/examples/lib/add_arm64.s @@ -0,0 +1,20 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +TEXT ·add(SB), $0 + MOVD x+0(FP), R0 + MOVD y+8(FP), R1 + ADD R0, R1, R0 + MOVD R0, ret+16(FP) + RET diff --git a/tests/legacy/examples/lib/sub.s b/tests/legacy/examples/lib/sub_amd64.s similarity index 100% rename from tests/legacy/examples/lib/sub.s rename to tests/legacy/examples/lib/sub_amd64.s diff --git a/tests/legacy/examples/lib/sub_arm64.s b/tests/legacy/examples/lib/sub_arm64.s new file mode 100644 index 0000000000..0af72ce83a --- /dev/null +++ b/tests/legacy/examples/lib/sub_arm64.s @@ -0,0 +1,20 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +TEXT ·sub(SB), $0 + MOVD x+0(FP), R0 + MOVD y+8(FP), R1 + SUB R0, R1, R0 + MOVD R0, ret+16(FP) + RET