1 /* { dg-do assemble } */ 2 /* { dg-options "-O2" } */ 3 4 extern void abort (void); 5 enum 6 { 7 __GCONV_OK = 0, 8 __GCONV_NOCONV, 9 __GCONV_NODB, 10 __GCONV_NOMEM, 11 __GCONV_EMPTY_INPUT, 12 __GCONV_FULL_OUTPUT, 13 __GCONV_ILLEGAL_INPUT, 14 __GCONV_INCOMPLETE_INPUT, 15 __GCONV_ILLEGAL_DESCRIPTOR, 16 __GCONV_INTERNAL_ERROR 17 }; 18 int foo(int result)19foo (int result) 20 { 21 int irreversible = 0; 22 switch (result) 23 { 24 case __GCONV_ILLEGAL_INPUT: 25 irreversible = -1L; 26 break; 27 case __GCONV_FULL_OUTPUT: 28 irreversible = -2L; 29 break; 30 case __GCONV_INCOMPLETE_INPUT: 31 irreversible = -3L; 32 break; 33 case __GCONV_EMPTY_INPUT: 34 case __GCONV_OK: 35 break; 36 default: 37 abort (); 38 } 39 return irreversible; 40 } 41