PR c++/37276
[official-gcc.git] / gcc / testsuite / gcc.dg / charset / builtin1.c
blob753049c96661f077f39beaf60d5dbd4d39491e21
1 /* isdigit(c) can be optimized to ((unsigned)c) - '0' <= 9, but only if
2 we know the correct value of '0'. PR 18785. */
4 /* { dg-do run } */
5 /* { dg-require-iconv "IBM1047" } */
6 /* { dg-options "-O2 -fno-inline -fexec-charset=IBM1047" } */
8 extern int isdigit(int);
9 extern void abort(void);
11 static int str1(void) { return '1'; }
12 static int strA(void) { return 'A'; }
14 int
15 main(void)
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;