aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/strcmpopt_12.c
blob: d8077b62f7f93182c2a219412ec6e88dbb955aca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* PR tree-optimization/96758 */
/* { dg-do run } */
/* { dg-options "-O2" } */

int v = 1;

int
main ()
{
  const char *s = v ? "a" : "b";
  char x[5];
  char y[5] = "a\0a";
  __builtin_memcpy (x, y, sizeof (y));
  if (__builtin_strncmp (x, s, 4) != 0)
    __builtin_abort ();
  return 0;
}