All pastes #800198 Raw Edit

testcases

public text v1 · immutable
#800198 ·published 2007-11-28 06:15 UTC
rendered paste body
Index: test/CodeGen/writable-strings.c
===================================================================
--- test/CodeGen/writable-strings.c	(revision 0)
+++ test/CodeGen/writable-strings.c	(revision 0)
@@ -0,0 +1,8 @@
+// RUN: clang -emit-llvm -fwritable-string %s
+
+int main() {
+    char *str = "abc";
+    str[0] = '1';
+    printf("%s", str);
+}
+
Index: test/CodeGen/shared-string-literals.c
===================================================================
--- test/CodeGen/shared-string-literals.c	(revision 0)
+++ test/CodeGen/shared-string-literals.c	(revision 0)
@@ -0,0 +1,9 @@
+// RUN: clang -emit-llvm %s
+
+char *globalString = "abc";
+char *globalStringArray[5] = { "123", "abc" };
+char *anotherGlobalString = "123";
+
+int main() {
+    printf("123");
+}