1 ; RUN: llc -march=mipsel -mattr=mips16 -relocation-model=pic -O3 < %s | FileCheck %s -check-prefix=16_h
2 ; RUN: llc -march=mipsel -mattr=mips16 -relocation-model=pic -O3 < %s | FileCheck %s -check-prefix=16_b
4 @.str = private unnamed_addr constant [9 x i8] c"%hd %c \0A\00", align 1
5 @sp = common global ptr null, align 4
6 @cp = common global ptr null, align 4
8 declare i32 @printf(ptr nocapture, ...) nounwind
10 define void @test() nounwind {
12 %s = alloca i16, align 4
13 %c = alloca i8, align 4
14 store i16 16, ptr %s, align 4
15 store i8 99, ptr %c, align 4
16 store ptr %s, ptr @sp, align 4
17 store ptr %c, ptr @cp, align 4
18 %call.i.i = call i32 (ptr, ...) @printf(ptr @.str, i32 16, i32 99) nounwind
19 %0 = load ptr, ptr @sp, align 4
20 store i16 32, ptr %0, align 2
21 %1 = load ptr, ptr @cp, align 4
22 store i8 97, ptr %1, align 1
23 %2 = load i16, ptr %s, align 4
24 %3 = load i8, ptr %c, align 4
25 %conv.i = sext i16 %2 to i32
26 %conv1.i = sext i8 %3 to i32
27 %call.i = call i32 (ptr, ...) @printf(ptr @.str, i32 %conv.i, i32 %conv1.i) nounwind
31 ; 16_b: sb ${{[0-9]+}}, [[offset1:[0-9]+]](${{[0-9]+}})
32 ; 16_b: lb ${{[0-9]+}}, [[offset1]](${{[0-9]+}})
33 ; 16_h: sh ${{[0-9]+}}, [[offset2:[0-9]+]](${{[0-9]+}})
34 ; 16_h: lh ${{[0-9]+}}, [[offset2]](${{[0-9]+}})
37 declare void @llvm.lifetime.start.p0(i64, ptr nocapture) nounwind
39 declare void @llvm.lifetime.end.p0(i64, ptr nocapture) nounwind