Skip to content

Commit

Permalink
selftests/powerpc: Add test for VPHN
Browse files Browse the repository at this point in the history
The goal is to verify vphn_unpack_associativity() parses VPHN numbers
correctly. We feed it with a variety of input values and compare with
expected results.

PAPR+ does not say much about VPHN parsing: I came up with a list of
tests that check many simple cases and some corner ones. I wouldn't
dare to say the list is exhaustive though.

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
[mpe: Rework harness logic, rename to test-vphn, add -m64]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
  • Loading branch information
Greg Kurz authored and Michael Ellerman committed Mar 17, 2015
1 parent 3338a65 commit 58dae82
Show file tree
Hide file tree
Showing 7 changed files with 430 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/powerpc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ CFLAGS := -Wall -O2 -flto -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CUR

export CC CFLAGS

TARGETS = pmu copyloops mm tm primitives stringloops
TARGETS = pmu copyloops mm tm primitives stringloops vphn

endif

Expand Down
1 change: 1 addition & 0 deletions tools/testing/selftests/powerpc/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ typedef signed long long s64;

/* Just for familiarity */
typedef uint32_t u32;
typedef uint16_t u16;
typedef uint8_t u8;


Expand Down
1 change: 1 addition & 0 deletions tools/testing/selftests/powerpc/vphn/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test-vphn
15 changes: 15 additions & 0 deletions tools/testing/selftests/powerpc/vphn/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
PROG := test-vphn

CFLAGS += -m64

all: $(PROG)

$(PROG): ../harness.c

run_tests: all
./$(PROG)

clean:
rm -f $(PROG)

.PHONY: all run_tests clean
Loading

0 comments on commit 58dae82

Please sign in to comment.