diff options
author | Christophe Leroy <christophe.leroy@c-s.fr> | 2018-08-01 05:01:10 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-08-07 07:49:29 -0400 |
commit | 1bb07b593adc1934a526eb04acfe8bf786decfd2 (patch) | |
tree | ca64a64fe72f10a654a97f643b628f6fdcc97330 | |
parent | 94675cceacaec27a30eefb142c4c59a9d3131742 (diff) |
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()
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
[mpe: Fix 64-bit build by adding build_32bit test]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r-- | tools/testing/selftests/powerpc/stringloops/Makefile | 20 | ||||
l--------- | tools/testing/selftests/powerpc/stringloops/memcmp_32.S | 1 |
2 files changed, 18 insertions, 3 deletions
diff --git a/tools/testing/selftests/powerpc/stringloops/Makefile b/tools/testing/selftests/powerpc/stringloops/Makefile index c60c6172dd3c..b682be18dc66 100644 --- a/tools/testing/selftests/powerpc/stringloops/Makefile +++ b/tools/testing/selftests/powerpc/stringloops/Makefile | |||
@@ -1,10 +1,24 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
2 | # The loops are all 64-bit code | 2 | # The loops are all 64-bit code |
3 | CFLAGS += -m64 -maltivec | ||
4 | CFLAGS += -I$(CURDIR) | 3 | CFLAGS += -I$(CURDIR) |
5 | 4 | ||
6 | TEST_GEN_PROGS := memcmp | 5 | EXTRA_SOURCES := ../harness.c |
7 | EXTRA_SOURCES := memcmp_64.S ../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) | ||
8 | 22 | ||
9 | include ../../lib.mk | 23 | include ../../lib.mk |
10 | 24 | ||
diff --git a/tools/testing/selftests/powerpc/stringloops/memcmp_32.S b/tools/testing/selftests/powerpc/stringloops/memcmp_32.S new file mode 120000 index 000000000000..056f2b3af789 --- /dev/null +++ b/tools/testing/selftests/powerpc/stringloops/memcmp_32.S | |||
@@ -0,0 +1 @@ | |||
../../../../../arch/powerpc/lib/memcmp_32.S \ No newline at end of file | |||