From: Balamuruhan S Date: Fri, 26 Jun 2020 09:51:56 +0000 (+0530) Subject: powerpc/test_emulate_step: Add negative tests for prefixed addi X-Git-Tag: v5.9-rc1~100^2~178 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7e67c73b939b25d4ad18a536e52282aa35d8ee56;p=thirdparty%2Fkernel%2Flinux.git powerpc/test_emulate_step: Add negative tests for prefixed addi testcases for `paddi` instruction to cover the negative case, if R is equal to 1 and RA is not equal to 0, the instruction form is invalid. Signed-off-by: Balamuruhan S Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200626095158.1031507-3-bala24@linux.ibm.com --- diff --git a/arch/powerpc/lib/test_emulate_step.c b/arch/powerpc/lib/test_emulate_step.c index 31065e986ff0c..7d11ab5ef86ca 100644 --- a/arch/powerpc/lib/test_emulate_step.c +++ b/arch/powerpc/lib/test_emulate_step.c @@ -1130,6 +1130,16 @@ static struct compute_test compute_tests[] = { .regs = { .gpr[21] = 0, } + }, + /* Invalid instruction form with R = 1 and RA != 0 */ + { + .descr = "RA = R22(0), SI = 0, R = 1", + .instr = TEST_PADDI(21, 22, 0, 1), + .flags = NEGATIVE_TEST, + .regs = { + .gpr[21] = 0, + .gpr[22] = 0, + } } } }