Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / pr47446-1.c
blob38c9594a69aa85d18826d990ebc543b944254a8e
1 /* { dg-do assemble } */
2 /* { dg-options "-O2" } */
4 extern void abort (void);
5 enum
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
18 int
19 foo (int result)
21 int irreversible = 0;
22 switch (result)
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 ();
39 return irreversible;