diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/riscv/pr107455-2.c')
-rw-r--r-- | gcc/testsuite/gcc.target/riscv/pr107455-2.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/riscv/pr107455-2.c b/gcc/testsuite/gcc.target/riscv/pr107455-2.c new file mode 100644 index 0000000..91106bb --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/pr107455-2.c @@ -0,0 +1,40 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -dp" } */ +/* This was extracted from coremark. */ + + +typedef signed short ee_s16; +typedef struct list_data_s +{ + ee_s16 data16; + ee_s16 idx; +} list_data; + +typedef struct list_head_s +{ + struct list_head_s *next; + struct list_data_s *info; +} list_head; + + +list_head * +core_list_find(list_head *list, list_data *info) +{ + if (info->idx >= 0) + { + while (list && (list->info->idx != info->idx)) + list = list->next; + return list; + } + else + { + while (list && ((list->info->data16 & 0xff) != info->data16)) + list = list->next; + return list; + } +} + +/* There was an unnecessary assignment to the return value until + recently. Scan for that in the resulting output. */ +/* { dg-final { scan-assembler-not "li\\ta0,0" } } */ + |