Bill Wendling | 3bf052b | 2012-01-11 19:33:37 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck %s |
| 2 | ; <rdar://problem/10564621> |
| 3 | |
| 4 | %0 = type opaque |
| 5 | %struct.NSConstantString = type { i32*, i32, i8*, i32 } |
| 6 | |
Sylvestre Ledru | c8e41c5 | 2012-07-23 08:51:15 +0000 | [diff] [blame] | 7 | ; Make sure that the string ends up the correct section. |
Bill Wendling | 3bf052b | 2012-01-11 19:33:37 +0000 | [diff] [blame] | 8 | |
| 9 | ; CHECK: .section __TEXT,__cstring |
| 10 | ; CHECK-NEXT: l_.str3: |
| 11 | |
| 12 | ; CHECK: .section __DATA,__cfstring |
| 13 | ; CHECK-NEXT: .align 4 |
| 14 | ; CHECK-NEXT: L__unnamed_cfstring_4: |
| 15 | ; CHECK-NEXT: .quad ___CFConstantStringClassReference |
| 16 | ; CHECK-NEXT: .long 1992 |
| 17 | ; CHECK-NEXT: .space 4 |
| 18 | ; CHECK-NEXT: .quad l_.str3 |
| 19 | ; CHECK-NEXT: .long 0 |
| 20 | ; CHECK-NEXT: .space 4 |
| 21 | |
| 22 | @isLogVisible = global i8 0, align 1 |
| 23 | @__CFConstantStringClassReference = external global [0 x i32] |
| 24 | @.str3 = linker_private unnamed_addr constant [1 x i8] zeroinitializer, align 1 |
| 25 | @_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" |
| 26 | @null.array = weak_odr constant [1 x i8] zeroinitializer, align 1 |
| 27 | |
| 28 | define linkonce_odr void @bar() nounwind ssp align 2 { |
| 29 | entry: |
| 30 | %stack = alloca i8*, align 4 |
| 31 | %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*)) |
| 32 | store i8* getelementptr inbounds ([1 x i8]* @null.array, i32 0, i32 0), i8** %stack, align 4 |
| 33 | ret void |
| 34 | } |
| 35 | |
| 36 | declare i8* @objc_msgSend(i8*, i8*, ...) nonlazybind |