1; RUN: llc -mtriple=thumb-eabi %s -o - | FileCheck %s 2 3define i32 @f1() { 4; CHECK-LABEL: f1: 5; CHECK: ldr r0 6 %buf = alloca [32 x i32], align 4 7 %tmp = getelementptr [32 x i32], [32 x i32]* %buf, i32 0, i32 0 8 %tmp1 = load i32, i32* %tmp 9 ret i32 %tmp1 10} 11 12define i32 @f2() { 13; CHECK-LABEL: f2: 14; CHECK: mov r0 15; CHECK: ldrb 16 %buf = alloca [32 x i8], align 4 17 %tmp = getelementptr [32 x i8], [32 x i8]* %buf, i32 0, i32 0 18 %tmp1 = load i8, i8* %tmp 19 %tmp2 = zext i8 %tmp1 to i32 20 ret i32 %tmp2 21} 22 23define i32 @f3() { 24; CHECK-LABEL: f3: 25; CHECK: ldr r0 26 %buf = alloca [32 x i32], align 4 27 %tmp = getelementptr [32 x i32], [32 x i32]* %buf, i32 0, i32 32 28 %tmp1 = load i32, i32* %tmp 29 ret i32 %tmp1 30} 31 32define i32 @f4() { 33; CHECK-LABEL: f4: 34; CHECK: mov r0 35; CHECK: ldrb 36 %buf = alloca [32 x i8], align 4 37 %tmp = getelementptr [32 x i8], [32 x i8]* %buf, i32 0, i32 2 38 %tmp1 = load i8, i8* %tmp 39 %tmp2 = zext i8 %tmp1 to i32 40 ret i32 %tmp2 41} 42