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