mirror of
https://github.com/intel/isa-l.git
synced 2025-12-12 04:55:19 +01:00
add volatile for igzip/checksum32_funs_test
When using RISC-V GCC 14, `gcc -O0` passes the test, but `gcc -O2` fails.
The log shows that it enters the branch `if (c_dut != c_ref) {`
even though `c_dut` and `c_ref` have the same value.
Adding `volatile` allows the test to pass.
Signed-off-by: sunyuechi <sunyuechi@iscas.ac.cn>
This commit is contained in:
@@ -126,7 +126,7 @@ main(int argc, char *argv[])
|
|||||||
int
|
int
|
||||||
zeros_test(func_case_t *test_func)
|
zeros_test(func_case_t *test_func)
|
||||||
{
|
{
|
||||||
uint32_t c_dut, c_ref;
|
volatile uint32_t c_dut, c_ref;
|
||||||
int fail = 0;
|
int fail = 0;
|
||||||
unsigned char *buf = NULL;
|
unsigned char *buf = NULL;
|
||||||
|
|
||||||
@@ -153,7 +153,7 @@ zeros_test(func_case_t *test_func)
|
|||||||
int
|
int
|
||||||
simple_pattern_test(func_case_t *test_func)
|
simple_pattern_test(func_case_t *test_func)
|
||||||
{
|
{
|
||||||
uint32_t c_dut, c_ref;
|
volatile uint32_t c_dut, c_ref;
|
||||||
int fail = 0;
|
int fail = 0;
|
||||||
unsigned char *buf = NULL;
|
unsigned char *buf = NULL;
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ simple_pattern_test(func_case_t *test_func)
|
|||||||
int
|
int
|
||||||
seeds_sizes_test(func_case_t *test_func)
|
seeds_sizes_test(func_case_t *test_func)
|
||||||
{
|
{
|
||||||
uint32_t c_dut, c_ref;
|
volatile uint32_t c_dut, c_ref;
|
||||||
int fail = 0;
|
int fail = 0;
|
||||||
int i;
|
int i;
|
||||||
uint32_t r, s;
|
uint32_t r, s;
|
||||||
@@ -251,7 +251,7 @@ seeds_sizes_test(func_case_t *test_func)
|
|||||||
int
|
int
|
||||||
eob_test(func_case_t *test_func)
|
eob_test(func_case_t *test_func)
|
||||||
{
|
{
|
||||||
uint32_t c_dut, c_ref;
|
volatile uint32_t c_dut, c_ref;
|
||||||
int fail = 0;
|
int fail = 0;
|
||||||
int i;
|
int i;
|
||||||
unsigned char *buf = NULL;
|
unsigned char *buf = NULL;
|
||||||
@@ -277,7 +277,7 @@ eob_test(func_case_t *test_func)
|
|||||||
int
|
int
|
||||||
update_test(func_case_t *test_func)
|
update_test(func_case_t *test_func)
|
||||||
{
|
{
|
||||||
uint32_t c_dut, c_ref;
|
volatile uint32_t c_dut, c_ref;
|
||||||
int fail = 0;
|
int fail = 0;
|
||||||
int i;
|
int i;
|
||||||
uint32_t r;
|
uint32_t r;
|
||||||
@@ -310,7 +310,7 @@ update_test(func_case_t *test_func)
|
|||||||
int
|
int
|
||||||
update_over_mod_test(func_case_t *test_func)
|
update_over_mod_test(func_case_t *test_func)
|
||||||
{
|
{
|
||||||
uint32_t c_dut, c_ref;
|
volatile uint32_t c_dut, c_ref;
|
||||||
int fail = 0;
|
int fail = 0;
|
||||||
int i;
|
int i;
|
||||||
unsigned char *buf = NULL;
|
unsigned char *buf = NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user