summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr43317.c
blob: cc5832aee36ed86df7ff1fd752540d918026cd89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-do compile } */
/* { dg-options "-O -fipa-struct-reorg -fwhole-program -g" } */

extern void *malloc(__SIZE_TYPE__);

struct S {
  int i;
};

int main(int argc, char *argv[])
{
  int i = argc;
  struct S *p = malloc(sizeof (struct S));
  return p[i].i;
}