Skip to content

Commit

Permalink
testsuite: arm: Use check-function-bodies in epilog-1.c test
Browse files Browse the repository at this point in the history
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 <torbjorn.svensson@foss.st.com>
(cherry picked from commit ec86e87)
  • Loading branch information
Torbjorn-Svensson committed Nov 8, 2024
1 parent 29284be commit 7244465
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions gcc/testsuite/gcc.target/arm/epilog-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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" } } */

0 comments on commit 7244465

Please sign in to comment.