gcc/testsuite/gcc.dg/strcmpopt_12.c
raw| 1 | /* PR tree-optimization/96758 */ |
| 2 | /* { dg-do run } */ |
| 3 | /* { dg-options "-O2" } */ |
| 4 | |
| 5 | int v = 1; |
| 6 | |
| 7 | int |
| 8 | main () |
| 9 | { |
| 10 | const char *s = v ? "a" : "b"; |
| 11 | char x[5]; |
| 12 | char y[5] = "a\0a"; |
| 13 | __builtin_memcpy (x, y, sizeof (y)); |
| 14 | if (__builtin_strncmp (x, s, 4) != 0) |
| 15 | __builtin_abort (); |
| 16 | return 0; |
| 17 | } |