gcc/testsuite/gcc.dg/strlenopt-43.c
raw| 1 | /* PR tree-optimization/83896 - ice in get_string_len on a call to strlen |
| 2 | with non-constant length |
| 3 | { dg-do compile } |
| 4 | { dg-options "-O2 -Wall" } */ |
| 5 | |
| 6 | #include "strlenopt.h" |
| 7 | |
| 8 | extern char a[5]; |
| 9 | extern char b[]; |
| 10 | |
| 11 | void f (void) |
| 12 | { |
| 13 | if (strlen (b) != 4) |
| 14 | memcpy (a, b, sizeof a); |
| 15 | } |