blob: 00495a1477fa45902819ab556205d0fd921e3e35 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
/* { dg-do run { target aarch64_sve_hw } } */
/* { dg-options "-O2 -ftree-vectorize" } */
#include "loop_add_4.c"
#define N 131
#define BASE 41
#define TEST_LOOP(TYPE, NAME, STEP) \
{ \
TYPE a[N]; \
for (int i = 0; i < N; ++i) \
{ \
a[i] = i * i + i % 5; \
asm volatile ("" ::: "memory"); \
} \
test_##TYPE##_##NAME (a, BASE, N); \
for (int i = 0; i < N; ++i) \
{ \
TYPE expected = i * i + i % 5 + BASE + i * STEP; \
if (a[i] != expected) \
__builtin_abort (); \
} \
}
int __attribute__ ((optimize (1)))
main (void)
{
TEST_ALL (TEST_LOOP)
}
|