[llvm-commits] [llvm] r147961 - /llvm/trunk/test/CodeGen/X86/cfstring.ll

Bill Wendling isanbard at gmail.com
Wed Jan 11 11:33:37 PST 2012


Author: void
Date: Wed Jan 11 13:33:37 2012
New Revision: 147961

URL: http://llvm.org/viewvc/llvm-project?rev=147961&view=rev
Log:
Check to make sure that the CFString's back store ends up in the correct section.

Added:
    llvm/trunk/test/CodeGen/X86/cfstring.ll

Added: llvm/trunk/test/CodeGen/X86/cfstring.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/cfstring.ll?rev=147961&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/cfstring.ll (added)
+++ llvm/trunk/test/CodeGen/X86/cfstring.ll Wed Jan 11 13:33:37 2012
@@ -0,0 +1,36 @@
+; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck %s
+; <rdar://problem/10564621>
+
+%0 = type opaque
+%struct.NSConstantString = type { i32*, i32, i8*, i32 }
+
+; Make sure that the string ends up the the correct section.
+
+; CHECK:        .section __TEXT,__cstring
+; CHECK-NEXT: l_.str3:
+
+; CHECK:        .section  __DATA,__cfstring
+; CHECK-NEXT:   .align  4
+; CHECK-NEXT: L__unnamed_cfstring_4:
+; CHECK-NEXT:   .quad  ___CFConstantStringClassReference
+; CHECK-NEXT:   .long  1992
+; CHECK-NEXT:   .space  4
+; CHECK-NEXT:   .quad  l_.str3
+; CHECK-NEXT:   .long  0
+; CHECK-NEXT:   .space  4
+
+ at isLogVisible = global i8 0, align 1
+ at __CFConstantStringClassReference = external global [0 x i32]
+ at .str3 = linker_private unnamed_addr constant [1 x i8] zeroinitializer, align 1
+ at _unnamed_cfstring_4 = private constant %struct.NSConstantString { i32* getelementptr inbounds ([0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([1 x i8]* @.str3, i32 0, i32 0), i32 0 }, section "__DATA,__cfstring"
+ at null.array = weak_odr constant [1 x i8] zeroinitializer, align 1
+
+define linkonce_odr void @bar() nounwind ssp align 2 {
+entry:
+  %stack = alloca i8*, align 4
+  %call = call %0* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %0* (i8*, i8*, %0*)*)(i8* null, i8* null, %0* bitcast (%struct.NSConstantString* @_unnamed_cfstring_4 to %0*))
+  store i8* getelementptr inbounds ([1 x i8]* @null.array, i32 0, i32 0), i8** %stack, align 4
+  ret void
+}
+
+declare i8* @objc_msgSend(i8*, i8*, ...) nonlazybind





More information about the llvm-commits mailing list