| 1 |
/* isdigit(c) can be optimized to ((unsigned)c) - '0' <= 9, but only if |
| 2 |
we know the correct value of '0'. PR 18785. */ |
| 3 |
|
| 4 |
/* { dg-do run } */ |
| 5 |
/* { dg-require-iconv "IBM1047" } */ |
| 6 |
/* { dg-options "-O2 -fno-inline -fexec-charset=IBM1047" } */ |
| 7 |
|
| 8 |
extern int isdigit(int); |
| 9 |
extern void abort(void); |
| 10 |
|
| 11 |
static int str1(void) { return '1'; } |
| 12 |
static int strA(void) { return 'A'; } |
| 13 |
|
| 14 |
int |
| 15 |
main(void) |
| 16 |
{ |
| 17 |
if (!isdigit('1')) |
| 18 |
abort(); |
| 19 |
if (isdigit('A')) |
| 20 |
abort(); |
| 21 |
if (!isdigit(str1())) |
| 22 |
abort(); |
| 23 |
if (isdigit(strA())) |
| 24 |
abort(); |
| 25 |
return 0; |
| 26 |
} |