1 ; RUN: llc < %s -mtriple=thumbv7-apple-ios -mattr=+vfp2,+thumb2 | FileCheck %s 2 ; rdar://7076238 3 4 @"\01LC" = external constant [36 x i8], align 1 ; <[36 x i8]*> [#uses=1] 5 6 define i32 @t(i32, ...) nounwind { 7 entry: 8 ; CHECK-LABEL: t: 9 ; CHECK: add r7, sp, #12 10 %1 = load i8*, i8** undef, align 4 ; <i8*> [#uses=3] 11 %2 = getelementptr i8, i8* %1, i32 4 ; <i8*> [#uses=1] 12 %3 = getelementptr i8, i8* %1, i32 8 ; <i8*> [#uses=1] 13 %4 = bitcast i8* %2 to i32* ; <i32*> [#uses=1] 14 %5 = load i32, i32* %4, align 4 ; <i32> [#uses=1] 15 %6 = trunc i32 %5 to i8 ; <i8> [#uses=1] 16 %7 = getelementptr i8, i8* %1, i32 12 ; <i8*> [#uses=1] 17 %8 = bitcast i8* %3 to i32* ; <i32*> [#uses=1] 18 %9 = load i32, i32* %8, align 4 ; <i32> [#uses=1] 19 %10 = trunc i32 %9 to i16 ; <i16> [#uses=1] 20 %11 = bitcast i8* %7 to i32* ; <i32*> [#uses=1] 21 %12 = load i32, i32* %11, align 4 ; <i32> [#uses=1] 22 %13 = trunc i32 %12 to i16 ; <i16> [#uses=1] 23 %14 = load i32, i32* undef, align 4 ; <i32> [#uses=2] 24 %15 = sext i8 %6 to i32 ; <i32> [#uses=2] 25 %16 = sext i16 %10 to i32 ; <i32> [#uses=2] 26 %17 = sext i16 %13 to i32 ; <i32> [#uses=2] 27 %18 = call i32 (i8*, ...) @printf(i8* getelementptr ([36 x i8], [36 x i8]* @"\01LC", i32 0, i32 0), i32 -128, i32 0, i32 %15, i32 %16, i32 %17, i32 0, i32 %14) nounwind ; <i32> [#uses=0] 28 %19 = add i32 0, %15 ; <i32> [#uses=1] 29 %20 = add i32 %19, %16 ; <i32> [#uses=1] 30 %21 = add i32 %20, %14 ; <i32> [#uses=1] 31 %22 = add i32 %21, %17 ; <i32> [#uses=1] 32 %23 = add i32 %22, 0 ; <i32> [#uses=1] 33 ret i32 %23 34 } 35 36 declare i32 @printf(i8* nocapture, ...) nounwind 37