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

struct b {
  char *volatile c;
};
struct b * __attribute__((noipa))
d()
{
  char *e;
  struct b *b = __builtin_malloc(sizeof(b));
  void *f = __builtin_malloc(1);

  e = __builtin_memcpy(f, "z", 1);
  b->c = e;
  return b;
}

int main()
{
  struct b b = *d();
  if (b.c[0] != 'z')
    __builtin_abort();
  return 0;
}