aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr92088-1.c
blob: b56f8ad665e3d45de7e0a4fd262daf9f478cc1e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* { dg-do run } */

int __attribute__((noipa))
g (char *p)
{
  return p[9];
}
int main (int argc, char **argv)
{
  struct S {
    char toto[argc + 16];
  };
  int f (struct S arg) {
      __builtin_strcpy(arg.toto, "helloworld");
      return g (arg.toto);
  }
  struct S bob;
  __builtin_strcpy(bob.toto, "coucoucoucou");
  if (f(bob) != 'd' || __builtin_strcmp (bob.toto, "coucoucoucou"))
    __builtin_abort ();
  return 0;
}