1; RUN: llc < %s -mtriple=i386-apple-darwin -relocation-model=pic -disable-fp-elim 2 3 %struct..0objc_selector = type opaque 4 %struct.NSString = type opaque 5 %struct.XCStringList = type { i32, %struct._XCStringListNode* } 6 %struct._XCStringListNode = type { [3 x i8], [0 x i8], i8 } 7 %struct.__builtin_CFString = type { i32*, i32, i8*, i32 } 8internal constant %struct.__builtin_CFString { i32* getelementptr ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr ([3 x i8], [3 x i8]* @"\01LC", i32 0, i32 0), i32 2 } ; <%struct.__builtin_CFString*>:0 [#uses=1] 9@__CFConstantStringClassReference = external global [0 x i32] ; <[0 x i32]*> [#uses=1] 10@"\01LC" = internal constant [3 x i8] c"NO\00" ; <[3 x i8]*> [#uses=1] 11@"\01LC1" = internal constant [1 x i8] zeroinitializer ; <[1 x i8]*> [#uses=1] 12@llvm.used1 = appending global [1 x i8*] [ i8* bitcast (%struct.NSString* (%struct.XCStringList*, %struct..0objc_selector*)* @"-[XCStringList stringRepresentation]" to i8*) ], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0] 13 14define %struct.NSString* @"-[XCStringList stringRepresentation]"(%struct.XCStringList* %self, %struct..0objc_selector* %_cmd) nounwind { 15entry: 16 %0 = load i32, i32* null, align 4 ; <i32> [#uses=1] 17 %1 = and i32 %0, 16777215 ; <i32> [#uses=1] 18 %2 = icmp eq i32 %1, 0 ; <i1> [#uses=1] 19 br i1 %2, label %bb44, label %bb4 20 21bb4: ; preds = %entry 22 %3 = load %struct._XCStringListNode*, %struct._XCStringListNode** null, align 4 ; <%struct._XCStringListNode*> [#uses=2] 23 %4 = icmp eq %struct._XCStringListNode* %3, null ; <i1> [#uses=1] 24 %5 = bitcast %struct._XCStringListNode* %3 to i32* ; <i32*> [#uses=1] 25 br label %bb37.outer 26 27bb6: ; preds = %bb37 28 br label %bb19 29 30bb19: ; preds = %bb37, %bb6 31 %.rle = phi i32 [ 0, %bb6 ], [ %10, %bb37 ] ; <i32> [#uses=1] 32 %bufptr.0.lcssa = phi i8* [ null, %bb6 ], [ null, %bb37 ] ; <i8*> [#uses=2] 33 %6 = and i32 %.rle, 16777215 ; <i32> [#uses=1] 34 %7 = icmp eq i32 %6, 0 ; <i1> [#uses=1] 35 br i1 %7, label %bb25.split, label %bb37 36 37bb25.split: ; preds = %bb19 38 call void @foo(i8* getelementptr ([1 x i8], [1 x i8]* @"\01LC1", i32 0, i32 0)) nounwind nounwind 39 br label %bb35.outer 40 41bb34: ; preds = %bb35, %bb35, %bb35, %bb35 42 %8 = getelementptr i8, i8* %bufptr.0.lcssa, i32 %totalLength.0.ph ; <i8*> [#uses=1] 43 store i8 92, i8* %8, align 1 44 br label %bb35.outer 45 46bb35.outer: ; preds = %bb34, %bb25.split 47 %totalLength.0.ph = add i32 0, %totalLength.1.ph ; <i32> [#uses=2] 48 br label %bb35 49 50bb35: ; preds = %bb35, %bb35.outer 51 %9 = load i8, i8* null, align 1 ; <i8> [#uses=1] 52 switch i8 %9, label %bb35 [ 53 i8 0, label %bb37.outer 54 i8 32, label %bb34 55 i8 92, label %bb34 56 i8 34, label %bb34 57 i8 39, label %bb34 58 ] 59 60bb37.outer: ; preds = %bb35, %bb4 61 %totalLength.1.ph = phi i32 [ 0, %bb4 ], [ %totalLength.0.ph, %bb35 ] ; <i32> [#uses=1] 62 %bufptr.1.ph = phi i8* [ null, %bb4 ], [ %bufptr.0.lcssa, %bb35 ] ; <i8*> [#uses=2] 63 br i1 %4, label %bb39.split, label %bb37 64 65bb37: ; preds = %bb37.outer, %bb19 66 %10 = load i32, i32* %5, align 4 ; <i32> [#uses=1] 67 br i1 false, label %bb6, label %bb19 68 69bb39.split: ; preds = %bb37.outer 70 %11 = bitcast i8* null to %struct.NSString* ; <%struct.NSString*> [#uses=2] 71 %12 = icmp eq i8* null, %bufptr.1.ph ; <i1> [#uses=1] 72 br i1 %12, label %bb44, label %bb42 73 74bb42: ; preds = %bb39.split 75 call void @quux(i8* %bufptr.1.ph) nounwind nounwind 76 ret %struct.NSString* %11 77 78bb44: ; preds = %bb39.split, %entry 79 %.0 = phi %struct.NSString* [ bitcast (%struct.__builtin_CFString* @0 to %struct.NSString*), %entry ], [ %11, %bb39.split ] ; <%struct.NSString*> [#uses=1] 80 ret %struct.NSString* %.0 81} 82 83declare void @foo(i8*) 84 85declare void @quux(i8*) 86