blob: 715abc072b4bf7ad36947c475f97468b6ed99abf [file] [log] [blame]
Daniel Sanders8008de52015-10-15 14:34:23 +00001; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mattr=mips16 -relocation-model=pic < %s | FileCheck %s -check-prefix=PIC
Reed Kotler0ff40012013-12-10 14:29:38 +00002
Daniel Sanders8008de52015-10-15 14:34:23 +00003; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mattr=mips16 -relocation-model=static < %s | FileCheck %s -check-prefix=STATIC
Reed Kotler0ff40012013-12-10 14:29:38 +00004
Reed Kotler0ff40012013-12-10 14:29:38 +00005
6@xi = common global i32 0, align 4
7@x = common global float 0.000000e+00, align 4
8@xd = common global double 0.000000e+00, align 8
9
10; Function Attrs: nounwind
11define void @it() #0 {
12entry:
13 %call = call i32 @i(i32 1)
14 store i32 %call, i32* @xi, align 4
15 ret void
Reed Kotler5c29d632013-12-15 20:49:30 +000016; PIC: .ent it
17; STATIC: .ent it
18; PIC: save $16, $17, $ra, [[FS:[0-9]+]]
19; STATIC: save $16, $ra, [[FS:[0-9]+]]
20; PIC: restore $16, $17, $ra, [[FS]]
21; STATIC: restore $16, $ra, [[FS]]
22; PIC: .end it
23; STATIC: .end it
Reed Kotler0ff40012013-12-10 14:29:38 +000024}
25
26declare i32 @i(i32) #1
27
28; Function Attrs: nounwind
29define void @ft() #0 {
30entry:
31 %call = call float @f()
32 store float %call, float* @x, align 4
33 ret void
Reed Kotler5c29d632013-12-15 20:49:30 +000034; PIC: .ent ft
35; PIC: save $16, $17, $ra, $18, [[FS:[0-9]+]]
36; PIC: restore $16, $17, $ra, $18, [[FS]]
37; PIC: .end ft
Reed Kotler0ff40012013-12-10 14:29:38 +000038}
39
40declare float @f() #1
41
42; Function Attrs: nounwind
43define void @dt() #0 {
44entry:
45 %call = call double @d()
46 store double %call, double* @xd, align 8
47 ret void
Reed Kotler5c29d632013-12-15 20:49:30 +000048; PIC: .ent dt
49; PIC: save $16, $17, $ra, $18, [[FS:[0-9]+]]
50; PIC: restore $16, $17, $ra, $18, [[FS]]
51; PIC: .end dt
Reed Kotler0ff40012013-12-10 14:29:38 +000052}
53
54declare double @d() #1
55
56; Function Attrs: nounwind
57define void @fft() #0 {
58entry:
David Blaikiea79ac142015-02-27 21:17:42 +000059 %0 = load float, float* @x, align 4
Reed Kotler0ff40012013-12-10 14:29:38 +000060 %call = call float @ff(float %0)
61 store float %call, float* @x, align 4
62 ret void
Reed Kotler5c29d632013-12-15 20:49:30 +000063; PIC: .ent fft
64; PIC: save $16, $17, $ra, $18, [[FS:[0-9]+]]
65; PIC: restore $16, $17, $ra, $18, [[FS]]
66; PIC: .end fft
Reed Kotler0ff40012013-12-10 14:29:38 +000067}
68
69declare float @ff(float) #1
70
71; Function Attrs: nounwind
72define void @vft() #0 {
73entry:
David Blaikiea79ac142015-02-27 21:17:42 +000074 %0 = load float, float* @x, align 4
Reed Kotler0ff40012013-12-10 14:29:38 +000075 call void @vf(float %0)
76 ret void
Reed Kotler5c29d632013-12-15 20:49:30 +000077; PIC: .ent vft
78; STATIC: .ent vft
79; PIC: save $16, $ra, [[FS:[0-9]+]]
80; STATIC: save $16, $ra, [[FS:[0-9]+]]
81; PIC: restore $16, $ra, [[FS]]
82; STATIC: restore $16, $ra, [[FS]]
83; PIC: .end vft
84; STATIC: .end vft
Reed Kotler0ff40012013-12-10 14:29:38 +000085}
86
87declare void @vf(float) #1
88
89attributes #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" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
90attributes #1 = { "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" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
91
92