aboutsummaryrefslogtreecommitdiff
path: root/SingleSource/Regression/C/gcc-c-torture/execute/pr47925.c
diff options
context:
space:
mode:
Diffstat (limited to 'SingleSource/Regression/C/gcc-c-torture/execute/pr47925.c')
-rw-r--r--SingleSource/Regression/C/gcc-c-torture/execute/pr47925.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/SingleSource/Regression/C/gcc-c-torture/execute/pr47925.c b/SingleSource/Regression/C/gcc-c-torture/execute/pr47925.c
new file mode 100644
index 00000000..89f54c13
--- /dev/null
+++ b/SingleSource/Regression/C/gcc-c-torture/execute/pr47925.c
@@ -0,0 +1,24 @@
+struct s { volatile struct s *next; };
+
+void __attribute__((noinline))
+bar (int ignored, int n)
+{
+ asm volatile ("");
+}
+
+int __attribute__((noinline))
+foo (volatile struct s *ptr, int n)
+{
+ int i;
+
+ bar (0, n);
+ for (i = 0; i < n; i++)
+ ptr = ptr->next;
+}
+
+int main (void)
+{
+ volatile struct s rec = { &rec };
+ foo (&rec, 10);
+ return 0;
+}