1 ; PR925 2 ; RUN: llc < %s -march=x86 | \ 3 ; RUN: grep mov.*str1 | count 1 4 5 target datalayout = "e-p:32:32" 6 target triple = "i686-apple-darwin8.7.2" 7 @str1 = internal constant [5 x i8] c"bonk\00" ; <[5 x i8]*> [#uses=1] 8 @str2 = internal constant [5 x i8] c"bork\00" ; <[5 x i8]*> [#uses=1] 9 @str = internal constant [8 x i8] c"perfwap\00" ; <[8 x i8]*> [#uses=1] 10 11 define void @foo(i32 %C) { 12 entry: 13 switch i32 %C, label %bb2 [ 14 i32 1, label %blahaha 15 i32 2, label %blahaha 16 i32 3, label %blahaha 17 i32 4, label %blahaha 18 i32 5, label %blahaha 19 i32 6, label %blahaha 20 i32 7, label %blahaha 21 i32 8, label %blahaha 22 i32 9, label %blahaha 23 i32 10, label %blahaha 24 ] 25 26 bb2: ; preds = %entry 27 %tmp5 = and i32 %C, 123 ; <i32> [#uses=1] 28 %tmp = icmp eq i32 %tmp5, 0 ; <i1> [#uses=1] 29 br i1 %tmp, label %blahaha, label %cond_true 30 31 cond_true: ; preds = %bb2 32 br label %blahaha 33 34 blahaha: ; preds = %cond_true, %bb2, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry 35 %s.0 = phi i8* [ getelementptr ([8 x i8]* @str, i32 0, i64 0), %cond_true ], [ getelementptr ([5 x i8]* @str1, i32 0, i64 0), %entry ], [ getelementptr ([5 x i8]* @str1, i32 0, i64 0), %entry ], [ getelementptr ([5 x i8]* @str1, i32 0, i64 0), %entry ], [ getelementptr ([5 x i8]* @str1, i32 0, i64 0), %entry ], [ getelementptr ([5 x i8]* @str1, i32 0, i64 0), %entry ], [ getelementptr ([5 x i8]* @str1, i32 0, i64 0), %entry ], [ getelementptr ([5 x i8]* @str1, i32 0, i64 0), %entry ], [ getelementptr ([5 x i8]* @str1, i32 0, i64 0), %entry ], [ getelementptr ([5 x i8]* @str1, i32 0, i64 0), %entry ], [ getelementptr ([5 x i8]* @str1, i32 0, i64 0), %entry ], [ getelementptr ([5 x i8]* @str2, i32 0, i64 0), %bb2 ] ; <i8*> [#uses=13] 36 %tmp8 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0] 37 %tmp10 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0] 38 %tmp12 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0] 39 %tmp14 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0] 40 %tmp16 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0] 41 %tmp18 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0] 42 %tmp20 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0] 43 %tmp22 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0] 44 %tmp24 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0] 45 %tmp26 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0] 46 %tmp28 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0] 47 %tmp30 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0] 48 %tmp32 = tail call i32 (i8*, ...)* @printf( i8* %s.0 ) ; <i32> [#uses=0] 49 ret void 50 } 51 52 declare i32 @printf(i8*, ...) 53