summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr18241-3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr18241-3.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr18241-3.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr18241-3.c b/gcc/testsuite/gcc.dg/pr18241-3.c
new file mode 100644
index 000000000..869b1e914
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr18241-3.c
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-options "-O1" } */
+
+void abort (void);
+
+void radix_tree_tag_clear (int *node)
+{
+ int *path[2], **pathp = path, height;
+ volatile int *addr;
+
+ height = 1;
+ pathp[0] = node;
+
+ while (height > 0) {
+ pathp[1] = pathp[0];
+ pathp++;
+ height--;
+ }
+
+ addr = pathp[0];
+ *addr = 1;
+}
+
+int main ()
+{
+ int n;
+ radix_tree_tag_clear (&n);
+ if (n != 1)
+ abort ();
+ return 0;
+}