| 1 |
/* { dg-do run { target { riscv_v } } } */ |
| 2 |
/* { dg-options "-O3 -mrvv-vector-bits=zvl" } */ |
| 3 |
|
| 4 |
#include <assert.h> |
| 5 |
#include "compress-3.c" |
| 6 |
|
| 7 |
int |
| 8 |
main (void) |
| 9 |
{ |
| 10 |
vnx16i test_1_x = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; |
| 11 |
vnx16i test_1_y |
| 12 |
= {16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; |
| 13 |
vnx16i test_1_except |
| 14 |
= {1, 3, 4, 6, 7, 8, 14, 15, 20, 21, 22, 23, 24, 25, 26, 27}; |
| 15 |
vnx16i test_1_real; |
| 16 |
test_1_real = test_1 (test_1_x, test_1_y); |
| 17 |
for (int i = 0; i < 16; i++) |
| 18 |
assert (test_1_real[i] == test_1_except[i]); |
| 19 |
|
| 20 |
vnx8i test_2_x = {0, 1, 2, 3, 4, 5, 6, 7}; |
| 21 |
vnx8i test_2_y = {8, 9, 10, 11, 12, 13, 14, 15}; |
| 22 |
vnx8i test_2_except = {0, 1, 2, 5, 10, 11, 12, 13}; |
| 23 |
vnx8i test_2_real; |
| 24 |
test_2_real = test_2 (test_2_x, test_2_y); |
| 25 |
for (int i = 0; i < 8; i++) |
| 26 |
assert (test_2_real[i] == test_2_except[i]); |
| 27 |
|
| 28 |
vnx4i test_3_x = {0, 1, 2, 3}; |
| 29 |
vnx4i test_3_y = {4, 5, 6, 7}; |
| 30 |
vnx4i test_3_except = {0, 2, 5, 6}; |
| 31 |
vnx4i test_3_real; |
| 32 |
test_3_real = test_3 (test_3_x, test_3_y); |
| 33 |
for (int i = 0; i < 4; i++) |
| 34 |
assert (test_3_real[i] == test_3_except[i]); |
| 35 |
|
| 36 |
vnx16ui test_4_x = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; |
| 37 |
vnx16ui test_4_y |
| 38 |
= {16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; |
| 39 |
vnx16ui test_4_except |
| 40 |
= {1, 3, 4, 6, 7, 8, 14, 15, 20, 21, 22, 23, 24, 25, 26, 27}; |
| 41 |
vnx16ui test_4_real; |
| 42 |
test_4_real = test_4 (test_4_x, test_4_y); |
| 43 |
for (int i = 0; i < 16; i++) |
| 44 |
assert (test_4_real[i] == test_4_except[i]); |
| 45 |
|
| 46 |
vnx8ui test_5_x = {0, 1, 2, 3, 4, 5, 6, 7}; |
| 47 |
vnx8ui test_5_y = {8, 9, 10, 11, 12, 13, 14, 15}; |
| 48 |
vnx8ui test_5_except = {0, 1, 2, 5, 10, 11, 12, 13}; |
| 49 |
vnx8ui test_5_real; |
| 50 |
test_5_real = test_5 (test_5_x, test_5_y); |
| 51 |
for (int i = 0; i < 8; i++) |
| 52 |
assert (test_5_real[i] == test_5_except[i]); |
| 53 |
|
| 54 |
vnx4ui test_6_x = {0, 1, 2, 3}; |
| 55 |
vnx4ui test_6_y = {4, 5, 6, 7}; |
| 56 |
vnx4ui test_6_except = {0, 2, 5, 6}; |
| 57 |
vnx4ui test_6_real; |
| 58 |
test_6_real = test_6 (test_6_x, test_6_y); |
| 59 |
for (int i = 0; i < 4; i++) |
| 60 |
assert (test_6_real[i] == test_6_except[i]); |
| 61 |
|
| 62 |
vnx8f test_7_x = {0, 1, 2, 3, 4, 5, 6, 7}; |
| 63 |
vnx8f test_7_y = {8, 9, 10, 11, 12, 13, 14, 15}; |
| 64 |
vnx8f test_7_except = {0, 1, 2, 5, 10, 11, 12, 13}; |
| 65 |
vnx8f test_7_real; |
| 66 |
test_7_real = test_7 (test_7_x, test_7_y); |
| 67 |
for (int i = 0; i < 8; i++) |
| 68 |
assert (test_7_real[i] == test_7_except[i]); |
| 69 |
|
| 70 |
vnx4f test_8_x = {0, 1, 2, 3}; |
| 71 |
vnx4f test_8_y = {4, 5, 6, 7}; |
| 72 |
vnx4f test_8_except = {0, 2, 5, 6}; |
| 73 |
vnx4f test_8_real; |
| 74 |
test_8_real = test_8 (test_8_x, test_8_y); |
| 75 |
for (int i = 0; i < 4; i++) |
| 76 |
assert (test_8_real[i] == test_8_except[i]); |
| 77 |
|
| 78 |
return 0; |
| 79 |
} |