Debian Codegraph @

gcc/testsuite/gcc.target/arm/lob4.c

raw
1 /* Check that GCC does not generate Armv8.1-M low over head loop instructions
2 if LR is modified within the loop. */
3 /* { dg-do compile } */
4 /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" "-mfloat-abi=hard" } } */
5 /* { dg-options "-march=armv8.1-m.main -mthumb -O3 --save-temps -mfloat-abi=soft" } */
6 /* { dg-require-effective-target arm_softfloat } */
7 #include <stdlib.h>
8 #include "lob.h"
9
10 int a[N];
11 int b[N];
12 int c[N];
13
14 static __attribute__ ((always_inline)) inline int
15 foo (int a, int b)
16 {
17 NO_LOB;
18 return a + b;
19 }
20
21 int
22 main (void)
23 {
24 for (int i = 0; i < N; i++)
25 {
26 a[i] = i;
27 b[i] = i * 2;
28 c[i] = foo(a[i], b[i]);
29 }
30
31 return 0;
32 }
33 /* { dg-final { scan-assembler-not {dls\s\S*,\s\S*} } } */
34 /* { dg-final { scan-assembler-not {le\slr,\s\S*} } } */