1 ; RUN: llc -march=mipsel -mattr=mips16 -relocation-model=pic -O3 < %s | FileCheck %s -check-prefix=16
3 @iiii = global i32 25, align 4
4 @jjjj = global i32 35, align 4
5 @kkkk = global i32 100, align 4
6 @t = global i32 25, align 4
7 @riii = common global i32 0, align 4
8 @rjjj = common global i32 0, align 4
9 @rkkk = common global i32 0, align 4
11 define void @temp(i32 %foo) nounwind {
13 %foo.addr = alloca i32, align 4
14 store i32 %foo, ptr %foo.addr, align 4
15 %0 = load i32, ptr %foo.addr, align 4
16 store i32 %0, ptr @t, align 4
20 define void @test() nounwind {
22 ; 16: .frame $sp,8,$ra
23 ; 16: save 8 # 16 bit inst
25 ; 16: move ${{[0-9]+}}, $sp
26 ; 16: subu $[[REGISTER:[0-9]+]], ${{[0-9]+}}, ${{[0-9]+}}
27 ; 16: move $sp, $[[REGISTER]]
28 %sssi = alloca i32, align 4
29 %ip = alloca ptr, align 4
30 %sssj = alloca i32, align 4
31 %0 = load i32, ptr @iiii, align 4
32 store i32 %0, ptr %sssi, align 4
33 %1 = load i32, ptr @kkkk, align 4
34 %mul = mul nsw i32 %1, 100
35 %2 = alloca i8, i32 %mul
36 store ptr %2, ptr %ip, align 4
37 %3 = load i32, ptr @jjjj, align 4
38 store i32 %3, ptr %sssj, align 4
39 %4 = load i32, ptr @jjjj, align 4
40 %5 = load i32, ptr @iiii, align 4
41 %6 = load ptr, ptr %ip, align 4
42 %arrayidx = getelementptr inbounds i32, ptr %6, i32 %5
43 store i32 %4, ptr %arrayidx, align 4
44 %7 = load i32, ptr @kkkk, align 4
45 %8 = load i32, ptr @jjjj, align 4
46 %9 = load ptr, ptr %ip, align 4
47 %arrayidx1 = getelementptr inbounds i32, ptr %9, i32 %8
48 store i32 %7, ptr %arrayidx1, align 4
49 %10 = load i32, ptr @iiii, align 4
50 %11 = load i32, ptr @kkkk, align 4
51 %12 = load ptr, ptr %ip, align 4
52 %arrayidx2 = getelementptr inbounds i32, ptr %12, i32 %11
53 store i32 %10, ptr %arrayidx2, align 4
54 %13 = load ptr, ptr %ip, align 4
55 %arrayidx3 = getelementptr inbounds i32, ptr %13, i32 25
56 %14 = load i32, ptr %arrayidx3, align 4
57 store i32 %14, ptr @riii, align 4
58 %15 = load ptr, ptr %ip, align 4
59 %arrayidx4 = getelementptr inbounds i32, ptr %15, i32 35
60 %16 = load i32, ptr %arrayidx4, align 4
61 store i32 %16, ptr @rjjj, align 4
62 %17 = load ptr, ptr %ip, align 4
63 %arrayidx5 = getelementptr inbounds i32, ptr %17, i32 100
64 %18 = load i32, ptr %arrayidx5, align 4
65 store i32 %18, ptr @rkkk, align 4
66 %19 = load i32, ptr @t, align 4
67 %20 = load ptr, ptr %ip, align 4
68 %arrayidx6 = getelementptr inbounds i32, ptr %20, i32 %19
69 %21 = load i32, ptr %arrayidx6, align 4
71 call void @temp(i32 %21)