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