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 <bal...@linux.ibm.com>
---
 arch/powerpc/lib/test_emulate_step.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/powerpc/lib/test_emulate_step.c 
b/arch/powerpc/lib/test_emulate_step.c
index 79acc899a618..f9825c275c31 100644
--- a/arch/powerpc/lib/test_emulate_step.c
+++ b/arch/powerpc/lib/test_emulate_step.c
@@ -1197,6 +1197,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),
+                               .negative = true,
+                               .regs = {
+                                       .gpr[21] = 0,
+                                       .gpr[22] = 0,
+                               }
                        }
                }
        }
-- 
2.24.1

Reply via email to