aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.apple/fwritable-strings.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.apple/fwritable-strings.c')
-rw-r--r--gcc/testsuite/gcc.apple/fwritable-strings.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.apple/fwritable-strings.c b/gcc/testsuite/gcc.apple/fwritable-strings.c
new file mode 100644
index 00000000000..4cf335a0db3
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/fwritable-strings.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-fwritable-strings" } */
+
+/*#include <stdio.h>*/
+void foo( void *dst)
+{
+ char *ucdst;
+
+ ucdst = (char *)dst;
+ ucdst++;
+ *ucdst = 'X';
+}
+
+int main()
+{
+ char *a = "Hello";
+ foo ((void *) a);
+ return 0;
+}