aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/960327-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.c-torture/execute/960327-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/execute/960327-1.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/960327-1.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/960327-1.c
new file mode 100644
index 000000000..bc82cb5da
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/960327-1.c
@@ -0,0 +1,30 @@
+#include <stdio.h>
+g ()
+{
+ return '\n';
+}
+
+f ()
+{
+ char s[] = "abcedfg012345";
+ char *sp = s + 12;
+
+ switch (g ())
+ {
+ case '\n':
+ break;
+ }
+
+ while (*--sp == '0')
+ ;
+ sprintf (sp + 1, "X");
+
+ if (s[12] != 'X')
+ abort ();
+}
+
+main ()
+{
+ f ();
+ exit (0);
+}