History

selftests/powerpc: Add test for 32 bits memcmp

This patch renames memcmp test to memcmp_64 and adds a memcmp_32 test for testing the 32 bits version of memcmp()

Christophe Leroy committed 8 years ago

Commit 1bb07b51 parent 94675cc2 files · +18 −3Browse files

Unified · Split

2 files
  1. tools/testing/selftests/powerpc/stringloops/Makefile +17 −3
  2. tools/testing/selftests/powerpc/stringloops/memcmp_32.S +1 −0
tools/testing/selftests/powerpc/stringloops/Makefile+17−3
@@ -1,10 +1,24 @@
11 # SPDX-License-Identifier: GPL-2.0
22 # The loops are all 64-bit code
3−CFLAGS += -m64 -maltivec
43 CFLAGS += -I$(CURDIR)
54
6−TEST_GEN_PROGS := memcmp
7−EXTRA_SOURCES := memcmp_64.S ../harness.c
5+EXTRA_SOURCES := ../harness.c
6+
7+build_32bit = $(shell if ($(CC) $(CFLAGS) -m32 -o /dev/null memcmp.c >/dev/null 2>&1) then echo "1"; fi)
8+
9+TEST_GEN_PROGS := memcmp_64
10+
11+$(OUTPUT)/memcmp_64: memcmp.c
12+$(OUTPUT)/memcmp_64: CFLAGS += -m64 -maltivec
13+
14+ifeq ($(build_32bit),1)
15+$(OUTPUT)/memcmp_32: memcmp.c
16+$(OUTPUT)/memcmp_32: CFLAGS += -m32
17+
18+TEST_GEN_PROGS += memcmp_32
19+endif
20+
21+ASFLAGS = $(CFLAGS)
822
923 include ../../lib.mk
1024
tools/testing/selftests/powerpc/stringloops/memcmp_32.S+1−0
@@ -0,0 +1 @@
1+../../../../../arch/powerpc/lib/memcmp_32.S