view gcc/testsuite/gcc.dg/torture/restrict-8.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
line wrap: on
line source

/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
/* { dg-options "-fdump-tree-fre1" } */

struct S { int i; void *p; int j; };
int
foo (struct S * __restrict p, int *q, int flag)
{
  int *x = &p->j;
  if (flag)
    x = &p->i;
  *q = 1;
  *x = 2;
  return *q;
}

/* { dg-final { scan-tree-dump "return 1;" "fre1" } } */