From 724446556e5cf2686a12076d282214f02119beb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20SVENSSON?= Date: Thu, 7 Nov 2024 20:09:48 +0100 Subject: [PATCH] testsuite: arm: Use check-function-bodies in epilog-1.c test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update test case for armv8.1-m.main that supports conditional arithmetic. armv7-m: push {r4, lr} ldr r4, .L6 ldr r4, [r4] lsls r4, r4, #29 it mi addmi r2, r2, #1 bl bar movs r0, #0 pop {r4, pc} armv8.1-m.main: push {r3, r4, r5, lr} ldr r4, .L5 ldr r5, [r4] tst r5, #4 csinc r2, r2, r2, eq bl bar movs r0, #0 pop {r3, r4, r5, pc} gcc/testsuite/ChangeLog: * gcc.target/arm/epilog-1.c: Use check-function-bodies. Signed-off-by: Torbjörn SVENSSON (cherry picked from commit ec86e87439b4a5cf73da6f318757f3561f9f278a) --- gcc/testsuite/gcc.target/arm/epilog-1.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/gcc.target/arm/epilog-1.c b/gcc/testsuite/gcc.target/arm/epilog-1.c index f97f1ebeaaf3e..a151645646069 100644 --- a/gcc/testsuite/gcc.target/arm/epilog-1.c +++ b/gcc/testsuite/gcc.target/arm/epilog-1.c @@ -2,16 +2,34 @@ /* { dg-do compile } */ /* { dg-options "-mthumb -Os" } */ /* { dg-require-effective-target arm_thumb2_ok } */ +/* { dg-final { check-function-bodies "**" "" } } */ volatile int g_k; extern void bar(int, int, int, int); +/* +** foo: +** ... +** ( + +Below block is for non-armv8.1-m.main +** lsls r[0-9]+, r[0-9]+, #29 +** it mi +** addmi r2, r2, #1 + +** | + +Below block is for armv8.1-m.main +** tst r[0-9]+, #4 +** csinc r2, r2, r2, eq + +** ) +** bl bar +** ... +*/ int foo(int a, int b, int c, int d) { if (g_k & 4) c++; bar (a, b, c, d); return 0; } - -/* { dg-final { scan-assembler-times "lsls.*#29" 1 } } */ -/* { dg-final { scan-assembler-not "tst" } } */