1 /* { dg-do compile } */
2 /* { dg-options "-O2 -dp" } */
3 /* This was extracted from coremark. */
4
5
6 typedef signed short ee_s16;
7 typedef struct list_data_s
8 {
9 ee_s16 data16;
10 ee_s16 idx;
11 } list_data;
12
13 typedef struct list_head_s
14 {
15 struct list_head_s *next;
16 struct list_data_s *info;
17 } list_head;
18
19
20 list_head *
21 core_list_find(list_head *list, list_data *info)
22 {
23 if (info->idx >= 0)
24 {
25 while (list && (list->info->idx != info->idx))
26 list = list->next;
27 return list;
28 }
29 else
30 {
31 while (list && ((list->info->data16 & 0xff) != info->data16))
32 list = list->next;
33 return list;
34 }
35 }
36
37 /* There is only one legitimate unconditional jump, so test for that,
38 which will catch the case where bb-reorder leaves a jump to a ret
39 in the IL. */
40 /* { dg-final { scan-assembler-times "jump" 1 } } */
41