blob: 6a4363c58136f870f94831cfef23acebfef1f893 [file] [log] [blame]
Reed Kotler3aeb1d02013-11-26 20:38:40 +00001; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=mips32 -relocation-model=static -O3 < %s -mips-os16 | FileCheck %s -check-prefix=32
2
3; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=mips32 -relocation-model=static -O3 -mips16-constant-islands < %s -mips-os16 | FileCheck %s -check-prefix=cisle
Reed Kotlerfe94cc32013-04-10 16:58:04 +00004
5@i = global i32 1, align 4
6@f = global float 1.000000e+00, align 4
7
8define void @vv() #0 {
9entry:
10 ret void
11}
12
13; 32: .set mips16 # @vv
14; 32: .ent vv
15
16; 32: save {{.+}}
17; 32: restore {{.+}}
18; 32: .end vv
19
20define i32 @iv() #0 {
21entry:
22 %0 = load i32* @i, align 4
23 ret i32 %0
24}
25
26; 32: .set mips16 # @iv
27; 32: .ent iv
28
29; 32: save {{.+}}
30; 32: restore {{.+}}
31; 32: .end iv
32
33define void @vif(i32 %i, float %f) #0 {
34entry:
35 %i.addr = alloca i32, align 4
36 %f.addr = alloca float, align 4
37 store i32 %i, i32* %i.addr, align 4
38 store float %f, float* %f.addr, align 4
39 ret void
40}
41
42; 32: .set mips16 # @vif
43; 32: .ent vif
44
45; 32: save {{.+}}
46; 32: restore {{.+}}
47; 32: .end vif
48
49define void @foo() #0 {
50entry:
51 store float 2.000000e+00, float* @f, align 4
52 ret void
53}
54
55; 32: .set mips16 # @foo
56; 32: .ent foo
57
58; 32: save {{.+}}
59; 32: restore {{.+}}
60; 32: .end foo
61
Reed Kotler3aeb1d02013-11-26 20:38:40 +000062; cisle: .end foo
63
Bill Wendling187d3dd2013-08-22 21:28:54 +000064attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
Reed Kotlerfe94cc32013-04-10 16:58:04 +000065
66
67define float @fv() #0 {
68entry:
69 ret float 1.000000e+00
70}
71
72; 32: .set nomips16 # @fv
73; 32: .ent fv
74; 32: .set noreorder
75; 32: .set nomacro
76; 32: .set noat
77; 32: jr $ra
78; 32: .set at
79; 32: .set macro
80; 32: .set reorder
81; 32: .end fv