Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/vls-vlmax/compress_run-4.c

raw
1 /* { dg-do run { target { riscv_v } } } */
2 /* { dg-options "-O3 -mrvv-vector-bits=zvl" } */
3
4 #include <assert.h>
5 #include "compress-4.c"
6
7 int
8 main (void)
9 {
10 vnx32i test_1_x
11 = {0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
12 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32};
13 vnx32i test_1_y
14 = {32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
15 48, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63, 64};
16 vnx32i test_1_except
17 = {4, 5, 7, 8, 10, 11, 15, 16, 18, 21, 22, 23, 25, 28, 30, 32,
18 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49};
19 vnx32i test_1_real;
20 test_1_real = test_1 (test_1_x, test_1_y);
21 for (int i = 0; i < 32; i++)
22 assert (test_1_real[i] == test_1_except[i]);
23
24 vnx16i test_2_x = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
25 vnx16i test_2_y
26 = {16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32};
27 vnx16i test_2_except
28 = {0, 3, 5, 7, 10, 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23};
29 vnx16i test_2_real;
30 test_2_real = test_2 (test_2_x, test_2_y);
31 for (int i = 0; i < 16; i++)
32 assert (test_2_real[i] == test_2_except[i]);
33
34 vnx8i test_3_x = {0, 1, 2, 4, 5, 6, 7, 8};
35 vnx8i test_3_y = {8, 10, 11, 12, 13, 14, 15, 16};
36 vnx8i test_3_except = {1, 2, 6, 8, 12, 13, 14, 15};
37 vnx8i test_3_real;
38 test_3_real = test_3 (test_3_x, test_3_y);
39 for (int i = 0; i < 8; i++)
40 assert (test_3_real[i] == test_3_except[i]);
41
42 vnx4i test_4_x = {0, 2, 3, 4};
43 vnx4i test_4_y = {4, 5, 7, 8};
44 vnx4i test_4_except = {2, 3, 5, 7};
45 vnx4i test_4_real;
46 test_4_real = test_4 (test_4_x, test_4_y);
47 for (int i = 0; i < 4; i++)
48 assert (test_4_real[i] == test_4_except[i]);
49
50 vnx32ui test_5_x
51 = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
52 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32};
53 vnx32ui test_5_y
54 = {32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
55 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 61, 62, 63, 64};
56 vnx32ui test_5_except
57 = {3, 4, 6, 7, 9, 10, 14, 15, 17, 20, 21, 22, 24, 27, 29, 32,
58 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49};
59 vnx32ui test_5_real;
60 test_5_real = test_5 (test_5_x, test_5_y);
61 for (int i = 0; i < 32; i++)
62 assert (test_5_real[i] == test_5_except[i]);
63
64 vnx16ui test_6_x = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16};
65 vnx16ui test_6_y
66 = {16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32};
67 vnx16ui test_6_except
68 = {0, 3, 5, 7, 10, 11, 15, 16, 16, 17, 19, 20, 21, 22, 23, 24};
69 vnx16ui test_6_real;
70 test_6_real = test_6 (test_6_x, test_6_y);
71 for (int i = 0; i < 16; i++)
72 assert (test_6_real[i] == test_6_except[i]);
73
74 vnx8ui test_7_x = {0, 2, 3, 4, 5, 6, 7, 8};
75 vnx8ui test_7_y = {8, 9, 10, 12, 13, 14, 15, 16};
76 vnx8ui test_7_except = {2, 3, 6, 8, 12, 13, 14, 15};
77 vnx8ui test_7_real;
78 test_7_real = test_7 (test_7_x, test_7_y);
79 for (int i = 0; i < 8; i++)
80 assert (test_7_real[i] == test_7_except[i]);
81
82 vnx4ui test_8_x = {0, 2, 3, 4};
83 vnx4ui test_8_y = {5, 6, 7, 8};
84 vnx4ui test_8_except = {2, 3, 6, 7};
85 vnx4ui test_8_real;
86 test_8_real = test_8 (test_8_x, test_8_y);
87 for (int i = 0; i < 4; i++)
88 assert (test_8_real[i] == test_8_except[i]);
89
90 vnx16f test_9_x = {0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
91 vnx16f test_9_y
92 = {16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32};
93 vnx16f test_9_except
94 = {0, 3, 6, 8, 11, 12, 15, 16, 16, 17, 18, 20, 21, 22, 23, 24};
95 vnx16f test_9_real;
96 test_9_real = test_9 (test_9_x, test_9_y);
97 for (int i = 0; i < 16; i++)
98 assert (test_9_real[i] == test_9_except[i]);
99
100 vnx8f test_10_x = {0, 1, 2, 3, 4, 5, 6, 7};
101 vnx8f test_10_y = {8, 9, 10, 12, 13, 14, 15, 16};
102 vnx8f test_10_except = {1, 2, 5, 7, 12, 13, 14, 15};
103 vnx8f test_10_real;
104 test_10_real = test_10 (test_10_x, test_10_y);
105 for (int i = 0; i < 8; i++)
106 assert (test_10_real[i] == test_10_except[i]);
107
108 vnx4f test_11_x = {0, 2, 3, 4};
109 vnx4f test_11_y = {4, 6, 7, 8};
110 vnx4f test_11_except = {2, 3, 6, 7};
111 vnx4f test_11_real;
112 test_11_real = test_11 (test_11_x, test_11_y);
113 for (int i = 0; i < 4; i++)
114 assert (test_11_real[i] == test_11_except[i]);
115
116 return 0;
117 }