summaryrefslogtreecommitdiff
path: root/test/CodeGen/darwin-string-literals.c
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-03-31 23:42:16 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-03-31 23:42:16 +0000
commit8e5c2b8072f4409c7c0004331d1db9652d5209c0 (patch)
treea0f47dbd90b7d5e4bcd465fee087c508de35ee0c /test/CodeGen/darwin-string-literals.c
parent3106198188ac6eb2753f1764d5c28376b0b76351 (diff)
downloadclang-8e5c2b8072f4409c7c0004331d1db9652d5209c0.tar.gz
Add Target hooks for IRgen of [cf]string literals.
- Notably, set section on cfstring literal string data (for now, this is done everywhere because it matches what we were already doing for the CFString data itself) - <rdar://problem/6599098> [irgen] linker requires objc string data to go into cstring git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68160 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/darwin-string-literals.c')
-rw-r--r--test/CodeGen/darwin-string-literals.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/CodeGen/darwin-string-literals.c b/test/CodeGen/darwin-string-literals.c
new file mode 100644
index 0000000000..5bfb84e91d
--- /dev/null
+++ b/test/CodeGen/darwin-string-literals.c
@@ -0,0 +1,9 @@
+// RUN: clang-cc -triple i386-apple-darwin9 -emit-llvm %s -o %t &&
+
+// RUN: grep -F '@"\01LC" = internal constant [8 x i8] c"string0\00"' %t &&
+// RUN: grep -F '@"\01LC1" = internal constant [8 x i8] c"string1\00", section "__TEXT,__cstring,cstring_literals"' %t &&
+
+// RUN: true
+
+const char *g0 = "string0";
+const void *g1 = __builtin___CFStringMakeConstantString("string1");