Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/vls-vlmax/consecutive_run-2.c

raw
1 /* { dg-do run { target { riscv_v } } } */
2 /* { dg-options "-O3 -mrvv-vector-bits=zvl" } */
3
4 #include <assert.h>
5 #include "consecutive-2.c"
6
7 int
8 main (void)
9 {
10 vnx8i test_1_x = {0, 1, 2, 3, 5, 6, 7, 8};
11 vnx8i test_1_y = {8, 9, 10, 11, 13, 14, 15, 16};
12 vnx8i test_1_except = {13, 14, 15, 16, 13, 14, 15, 16};
13 vnx8i test_1_real;
14 test_1_real = test_1 (test_1_x, test_1_y);
15 for (int i = 0; i < 8; i++)
16 assert (test_1_real[i] == test_1_except[i]);
17
18 vnx4i test_2_x = {1, 2, 3, 4};
19 vnx4i test_2_y = {5, 6, 7, 8};
20 vnx4i test_2_except = {5, 6, 5, 6};
21 vnx4i test_2_real;
22 test_2_real = test_2 (test_2_x, test_2_y);
23 for (int i = 0; i < 4; i++)
24 assert (test_2_real[i] == test_2_except[i]);
25
26 vnx8ui test_3_x = {0, 1, 2, 3, 4, 5, 6, 8};
27 vnx8ui test_3_y = {8, 9, 10, 11, 12, 13, 15, 16};
28 vnx8ui test_3_except = {12, 13, 15, 16, 12, 13, 15, 16};
29 vnx8ui test_3_real;
30 test_3_real = test_3 (test_3_x, test_3_y);
31 for (int i = 0; i < 8; i++)
32 assert (test_3_real[i] == test_3_except[i]);
33
34 vnx4ui test_4_x = {1, 2, 3, 4};
35 vnx4ui test_4_y = {4, 5, 6, 8};
36 vnx4ui test_4_except = {4, 5, 4, 5};
37 vnx4ui test_4_real;
38 test_4_real = test_4 (test_4_x, test_4_y);
39 for (int i = 0; i < 4; i++)
40 assert (test_4_real[i] == test_4_except[i]);
41
42 vnx4f test_5_x = {0, 1, 3, 4};
43 vnx4f test_5_y = {4, 5, 6, 7};
44 vnx4f test_5_except = {4, 5, 4, 5};
45 vnx4f test_5_real;
46 test_5_real = test_5 (test_5_x, test_5_y);
47 for (int i = 0; i < 4; i++)
48 assert (test_5_real[i] == test_5_except[i]);
49
50 return 0;
51 }