gcc/testsuite/gcc.dg/pr58668.c
raw| 1 | /* PR rtl-optimization/58668 */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-options "-O2" } */ |
| 4 | /* { dg-additional-options "-mthumb" { target { { arm*-*-* } && arm_thumb2_ok } } } */ |
| 5 | |
| 6 | void *fn1 (void *); |
| 7 | void *fn2 (void *, const char *); |
| 8 | void fn3 (void *); |
| 9 | void fn4 (void *, int); |
| 10 | |
| 11 | void * |
| 12 | test (void *x) |
| 13 | { |
| 14 | void *a, *b; |
| 15 | if (!(a = fn1 (x))) |
| 16 | return (void *) 0; |
| 17 | if (!(b = fn2 (a, "w"))) |
| 18 | { |
| 19 | fn3 (a); |
| 20 | return (void *) 0; |
| 21 | } |
| 22 | fn3 (a); |
| 23 | fn4 (b, 1); |
| 24 | return b; |
| 25 | } |