Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/pr121845.c

raw
1 /* { dg-do run } */
2 /* { dg-require-effective-target riscv_v_ok } */
3 /* { dg-options "-march=rv64gcv -mabi=lp64d -O0" } */
4
5 #include <stdint.h>
6 typedef uint32_t a;
7 typedef uint64_t uint64;
8
9 uint64 b;
10 __attribute__ ((__vector_size__ (4 * sizeof (a)))) a f = {504339, 7, 3};
11 uint64 *g = &b;
12
13 int32_t *
14 c (uint8_t, int32_t *, uint32_t, uint32_t, int64_t);
15 int8_t
16 d ()
17 {
18 int32_t e;
19 c (0, &e, 0, 0, 1);
20 return 0;
21 }
22
23 int32_t *
24 c (uint8_t, int32_t *j, uint32_t, uint32_t, int64_t)
25 {
26 f = __builtin_shufflevector (f, f, 0, 3, 2, 1);
27 *g = f[2];
28 return j;
29 }
30
31 int
32 main ()
33 {
34 d ();
35 if (b != 3)
36 __builtin_abort ();
37 }