From 5e34e259cc6f01557a077e3b213aa1302786d643 Mon Sep 17 00:00:00 2001 From: rguenth Date: Tue, 29 Oct 2013 14:29:22 +0000 Subject: [PATCH] 2013-10-29 Richard Biener * gcc.dg/torture/restrict-2.c: New testcase. * gcc.dg/torture/restrict-3.c: Likewise. * gcc.dg/torture/restrict-4.c: Likewise. * gcc.dg/torture/restrict-5.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204162 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/gcc.dg/torture/restrict-2.c | 27 +++++++++++++++++++++++++++ gcc/testsuite/gcc.dg/torture/restrict-3.c | 26 ++++++++++++++++++++++++++ gcc/testsuite/gcc.dg/torture/restrict-4.c | 26 ++++++++++++++++++++++++++ gcc/testsuite/gcc.dg/torture/restrict-5.c | 25 +++++++++++++++++++++++++ 5 files changed, 111 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/torture/restrict-2.c create mode 100644 gcc/testsuite/gcc.dg/torture/restrict-3.c create mode 100644 gcc/testsuite/gcc.dg/torture/restrict-4.c create mode 100644 gcc/testsuite/gcc.dg/torture/restrict-5.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 69937edf632..7e5438f5841 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2013-10-29 Richard Biener + + * gcc.dg/torture/restrict-2.c: New testcase. + * gcc.dg/torture/restrict-3.c: Likewise. + * gcc.dg/torture/restrict-4.c: Likewise. + * gcc.dg/torture/restrict-5.c: Likewise. + 2013-10-29 Marc Glisse PR tree-optimization/19831 diff --git a/gcc/testsuite/gcc.dg/torture/restrict-2.c b/gcc/testsuite/gcc.dg/torture/restrict-2.c new file mode 100644 index 00000000000..ec51ade6163 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/restrict-2.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ + +extern void abort (void); + +static inline void +foo (int * p) +{ + int * __restrict pr = p; + *pr = 1; +} + +int __attribute__((noinline,noclone)) +bar (int *q) +{ + int * __restrict qr = q; + *qr = 0; + foo (qr); + return *qr; +} + +int main() +{ + int i; + if (bar (&i) != 1) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/restrict-3.c b/gcc/testsuite/gcc.dg/torture/restrict-3.c new file mode 100644 index 00000000000..d815b8076e6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/restrict-3.c @@ -0,0 +1,26 @@ +/* { dg-do run } */ + +extern void abort (void); + +static inline void +foo (int * __restrict pr) +{ + *pr = 1; +} + +int __attribute__((noinline,noclone)) +bar (int *q) +{ + int * __restrict qr = q; + *qr = 0; + foo (qr); + return *qr; +} + +int main() +{ + int i; + if (bar (&i) != 1) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/restrict-4.c b/gcc/testsuite/gcc.dg/torture/restrict-4.c new file mode 100644 index 00000000000..52994d48b2e --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/restrict-4.c @@ -0,0 +1,26 @@ +/* { dg-do run } */ + +extern void abort (void); + +static inline void +foo (int * p) +{ + int * __restrict pr = p; + *pr = 1; +} + +int __attribute__((noinline,noclone)) +bar (int * __restrict qr) +{ + *qr = 0; + foo (qr); + return *qr; +} + +int main() +{ + int i; + if (bar (&i) != 1) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/restrict-5.c b/gcc/testsuite/gcc.dg/torture/restrict-5.c new file mode 100644 index 00000000000..233a9075f96 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/restrict-5.c @@ -0,0 +1,25 @@ +/* { dg-do run } */ + +extern void abort (void); + +static inline void +foo (int * __restrict pr) +{ + *pr = 1; +} + +int __attribute__((noinline,noclone)) +bar (int * __restrict qr) +{ + *qr = 0; + foo (qr); + return *qr; +} + +int main() +{ + int i; + if (bar (&i) != 1) + abort (); + return 0; +} -- 2.11.4.GIT