summaryrefslogtreecommitdiff
path: root/support/regression/tests/gcc-torture-execute-restrict-1.c
blob: 80e3f9531e64e88bd15ff2ccfb52e6968b247fcb (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
restrict-1.c from the execute part of the gcc torture tests.
*/

#include <testfwk.h>

/*  PR rtl-optimization/16536
    Origin:  Jeremy Denise      <jeremy.denise@libertysurf.fr>
    Reduced: Wolfgang Bangerth  <bangerth@dealii.org>
             Volker Reichelt    <reichelt@igpm.rwth-aachen.de>  */
/* { dg-options "-fgnu89-inline" } */

typedef struct
{
  int i, dummy;
} A;
#if 0 // TODO: Enable when compound literals are supported
inline A foo (const A* p, const A* q)
{
  return (A){p->i+q->i};
}

void bar (A* __restrict__ p)
{
  *p=foo(p,p);
  if (p->i!=2)
    abort();
}
#endif
void
testTortureExecute (void)
{
#if 0 // TODO: Enable when compound literals are supported
  A a={1};
  bar(&a);
  return 0;
#endif
}