[AArch64] Fix SVE testsuite failures for ILP32 (PR 83846)
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / sve / spill_7.c
blobb79d267483a0881c21ff9207826ec2481d7a2d96
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-vectorize -ffast-math" } */
4 #include <stdint.h>
6 void consumer (void *);
8 #define TEST_LOOP(TYPE, VAL) \
9 void \
10 multi_loop_##TYPE (TYPE *x, int n) \
11 { \
12 for (int k = 0; k < 4; ++k) \
13 { \
14 for (int j = 0; j < n; ++j) \
15 { \
16 for (int i = 0; i < 100; ++i) \
17 x[i] += VAL + i; \
18 asm volatile (""); \
19 } \
20 for (int j = 0; j < n; ++j) \
21 consumer (x); \
22 for (int j = 0; j < n; ++j) \
23 { \
24 for (int i = 0; i < 100; ++i) \
25 x[i] += VAL + i; \
26 asm volatile (""); \
27 } \
28 consumer (x); \
29 for (int i = 0; i < 100; ++i) \
30 x[i] += VAL + i; \
31 consumer (x); \
32 } \
35 TEST_LOOP (uint8_t, 3);
36 TEST_LOOP (uint16_t, 4);
37 TEST_LOOP (uint32_t, 5);
38 TEST_LOOP (uint64_t, 6);
39 TEST_LOOP (float, 2.5f);
40 TEST_LOOP (double, 3.5);
42 /* { dg-final { scan-assembler-times {\tindex\tz[0-9]+\..,} 18 } } */
43 /* { dg-final { scan-assembler-not {\tldr\tz[0-9]} } } */
44 /* { dg-final { scan-assembler-not {\tstr\tz[0-9]} } } */
45 /* { dg-final { scan-assembler-not {\tldr\tp[0-9]} } } */
46 /* { dg-final { scan-assembler-not {\tstr\tp[0-9]} } } */