Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/struct/struct_vect_run-15.c

raw
1 /* { dg-do run { target { riscv_v } } } */
2 /* { dg-additional-options "-mrvv-vector-bits=scalable -fno-vect-cost-model" } */
3
4 #include "struct_vect-15.c"
5
6 #undef TEST_LOOP
7 #define TEST_LOOP(NAME, TYPE) \
8 { \
9 TYPE out[N]; \
10 TYPE in[N * 2]; \
11 for (int i = 0; i < N; ++i) \
12 { \
13 out[i] = i * 7 / 2; \
14 asm volatile ("" ::: "memory"); \
15 } \
16 for (int i = 0; i < N * 2; ++i) \
17 { \
18 in[i] = i * 9 / 2; \
19 asm volatile ("" ::: "memory"); \
20 } \
21 NAME (out, in); \
22 for (int i = 0; i < N; ++i) \
23 { \
24 TYPE expected = i * 7 / 2 + in[i * 2]; \
25 if (out[i] != expected) \
26 __builtin_abort (); \
27 asm volatile ("" ::: "memory"); \
28 } \
29 }
30
31 int __attribute__ ((optimize (1)))
32 main (void)
33 {
34 TEST (test);
35 return 0;
36 }