aboutsummaryrefslogtreecommitdiff
path: root/SingleSource/Regression/C/gcc-c-torture/execute/pr43560.c
diff options
context:
space:
mode:
Diffstat (limited to 'SingleSource/Regression/C/gcc-c-torture/execute/pr43560.c')
-rw-r--r--SingleSource/Regression/C/gcc-c-torture/execute/pr43560.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/SingleSource/Regression/C/gcc-c-torture/execute/pr43560.c b/SingleSource/Regression/C/gcc-c-torture/execute/pr43560.c
new file mode 100644
index 00000000..cb420c61
--- /dev/null
+++ b/SingleSource/Regression/C/gcc-c-torture/execute/pr43560.c
@@ -0,0 +1,28 @@
+/* PR tree-optimization/43560 */
+
+struct S
+{
+ int a, b;
+ char c[10];
+};
+
+__attribute__ ((noinline)) void
+test (struct S *x)
+{
+ while (x->b > 1 && x->c[x->b - 1] == '/')
+ {
+ x->b--;
+ x->c[x->b] = '\0';
+ }
+}
+
+const struct S s = { 0, 0, "" };
+
+int
+main ()
+{
+ struct S *p;
+ asm ("" : "=r" (p) : "0" (&s));
+ test (p);
+ return 0;
+}