aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-3.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-3.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-3.c
new file mode 100644
index 000000000..d815b8076
--- /dev/null
+++ b/gcc-4.9/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;
+}