| 1 |
/* PR tree-optimization/49243 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2 -Winline" } */ |
| 4 |
|
| 5 |
extern unsigned long jb[]; |
| 6 |
extern int my_setjmp(unsigned long jb[]) __attribute__((returns_twice)); |
| 7 |
extern int decode(const char*); |
| 8 |
|
| 9 |
static inline int wrapper(const char **s_ptr) /* { dg-warning "(inlining failed|function 'wrapper' can never be inlined because it uses setjmp)" } */ |
| 10 |
{ |
| 11 |
if (my_setjmp(jb) == 0) { |
| 12 |
const char *s = *s_ptr; |
| 13 |
while (decode(s) != 0) |
| 14 |
*s_ptr = ++s; |
| 15 |
return 0; |
| 16 |
} else |
| 17 |
return -1; |
| 18 |
} |
| 19 |
|
| 20 |
void parse(const char *data) |
| 21 |
{ |
| 22 |
const char *s = data; |
| 23 |
if (!(wrapper(&s) == -1 && (s - data) == 1)) /* { dg-message "called from here" } */ |
| 24 |
__builtin_abort(); |
| 25 |
} |