1 /* { dg-options "-Os -msave-restore" } */
2 
3 /* With -msave-restore in use it should not be possible to remove the calls
4    to the save and restore stubs in this case (in current GCC).  */
5 
6 enum
7   {
8    VAL_A,
9    VAL_B,
10    VAL_C,
11    VAL_D
12   } a;
13 
14 extern void other_1 ();
15 extern void other_2 ();
16 
func()17 void func ()
18 {
19   switch (a)
20     {
21     case VAL_B:
22     case VAL_C:
23       other_1 ();
24     case VAL_D:
25       other_2 ();
26     }
27 }
28 
29 /* { dg-final { scan-assembler "call\[ \t\]*t0,__riscv_save_0" } } */
30 /* { dg-final { scan-assembler "tail\[ \t\]*__riscv_restore_0" } } */
31