diff options
Diffstat (limited to 'SingleSource/Regression/C/gcc-c-torture/execute/restrict-1.c')
-rw-r--r-- | SingleSource/Regression/C/gcc-c-torture/execute/restrict-1.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/SingleSource/Regression/C/gcc-c-torture/execute/restrict-1.c b/SingleSource/Regression/C/gcc-c-torture/execute/restrict-1.c new file mode 100644 index 00000000..c5528615 --- /dev/null +++ b/SingleSource/Regression/C/gcc-c-torture/execute/restrict-1.c @@ -0,0 +1,31 @@ +/* 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" } */ + +extern void abort (); + +typedef struct +{ + int i, dummy; +} A; + +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(); +} + +int main () +{ + A a={1}; + bar(&a); + return 0; +} |