[cfe-commits] r44397 - in /cfe/trunk/test/CodeGen: shared-string-literals.c writable-strings.c

Oliver Hunt oliver at apple.com
Tue Nov 27 22:27:12 PST 2007


Author: oliver
Date: Wed Nov 28 00:27:12 2007
New Revision: 44397

URL: http://llvm.org/viewvc/llvm-project?rev=44397&view=rev
Log:
Adding code gen tests for writable and shared string literals.


Added:
    cfe/trunk/test/CodeGen/shared-string-literals.c
    cfe/trunk/test/CodeGen/writable-strings.c

Added: cfe/trunk/test/CodeGen/shared-string-literals.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/shared-string-literals.c?rev=44397&view=auto

==============================================================================
--- cfe/trunk/test/CodeGen/shared-string-literals.c (added)
+++ cfe/trunk/test/CodeGen/shared-string-literals.c Wed Nov 28 00:27:12 2007
@@ -0,0 +1,9 @@
+// RUN: clang -emit-llvm %s
+
+char *globalString = "abc";
+char *globalStringArray[5] = { "123", "abc" };
+char *anotherGlobalString = "123";
+
+int main() {
+    printf("123");
+}

Added: cfe/trunk/test/CodeGen/writable-strings.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/writable-strings.c?rev=44397&view=auto

==============================================================================
--- cfe/trunk/test/CodeGen/writable-strings.c (added)
+++ cfe/trunk/test/CodeGen/writable-strings.c Wed Nov 28 00:27:12 2007
@@ -0,0 +1,8 @@
+// RUN: clang -emit-llvm -fwritable-string %s
+
+int main() {
+    char *str = "abc";
+    str[0] = '1';
+    printf("%s", str);
+}
+





More information about the cfe-commits mailing list