PR c/64856
[official-gcc.git] / gcc / testsuite / gcc.dg / pr49243.c
blobf896b05b06018da00d078ec10bcaa446617bfd9a
1 /* PR tree-optimization/49243 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -Winline" } */
5 extern unsigned long jb[];
6 extern int my_setjmp(unsigned long jb[]) __attribute__((returns_twice));
7 extern int decode(const char*);
9 static inline int wrapper(const char **s_ptr) /* { dg-warning "(inlining failed|function 'wrapper' can never be inlined because it uses setjmp)" } */
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;
20 void parse(const char *data)
22 const char *s = data;
23 if (!(wrapper(&s) == -1 && (s - data) == 1)) /* { dg-warning "called from here" } */
24 __builtin_abort();