summaryrefslogtreecommitdiff
path: root/test/CodeGen/Mips/s2rem.ll
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2014-11-24 09:08:18 +0000
committerDimitry Andric <dim@FreeBSD.org>2014-11-24 09:08:18 +0000
commit5ca98fd98791947eba83a1ed3f2c8191ef7afa6c (patch)
treef5944309621cee4fe0976be6f9ac619b7ebfc4c2 /test/CodeGen/Mips/s2rem.ll
parent68bcb7db193e4bc81430063148253d30a791023e (diff)
Notes
Diffstat (limited to 'test/CodeGen/Mips/s2rem.ll')
-rw-r--r--test/CodeGen/Mips/s2rem.ll92
1 files changed, 92 insertions, 0 deletions
diff --git a/test/CodeGen/Mips/s2rem.ll b/test/CodeGen/Mips/s2rem.ll
new file mode 100644
index 000000000000..9edb5be2771e
--- /dev/null
+++ b/test/CodeGen/Mips/s2rem.ll
@@ -0,0 +1,92 @@
+; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=mips16 -relocation-model=pic < %s | FileCheck %s -check-prefix=PIC
+
+; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=mips16 -relocation-model=static < %s | FileCheck %s -check-prefix=STATIC
+
+
+@xi = common global i32 0, align 4
+@x = common global float 0.000000e+00, align 4
+@xd = common global double 0.000000e+00, align 8
+
+; Function Attrs: nounwind
+define void @it() #0 {
+entry:
+ %call = call i32 @i(i32 1)
+ store i32 %call, i32* @xi, align 4
+ ret void
+; PIC: .ent it
+; STATIC: .ent it
+; PIC: save $16, $17, $ra, [[FS:[0-9]+]]
+; STATIC: save $16, $ra, [[FS:[0-9]+]]
+; PIC: restore $16, $17, $ra, [[FS]]
+; STATIC: restore $16, $ra, [[FS]]
+; PIC: .end it
+; STATIC: .end it
+}
+
+declare i32 @i(i32) #1
+
+; Function Attrs: nounwind
+define void @ft() #0 {
+entry:
+ %call = call float @f()
+ store float %call, float* @x, align 4
+ ret void
+; PIC: .ent ft
+; PIC: save $16, $17, $ra, $18, [[FS:[0-9]+]]
+; PIC: restore $16, $17, $ra, $18, [[FS]]
+; PIC: .end ft
+}
+
+declare float @f() #1
+
+; Function Attrs: nounwind
+define void @dt() #0 {
+entry:
+ %call = call double @d()
+ store double %call, double* @xd, align 8
+ ret void
+; PIC: .ent dt
+; PIC: save $16, $17, $ra, $18, [[FS:[0-9]+]]
+; PIC: restore $16, $17, $ra, $18, [[FS]]
+; PIC: .end dt
+}
+
+declare double @d() #1
+
+; Function Attrs: nounwind
+define void @fft() #0 {
+entry:
+ %0 = load float* @x, align 4
+ %call = call float @ff(float %0)
+ store float %call, float* @x, align 4
+ ret void
+; PIC: .ent fft
+; PIC: save $16, $17, $ra, $18, [[FS:[0-9]+]]
+; PIC: restore $16, $17, $ra, $18, [[FS]]
+; PIC: .end fft
+}
+
+declare float @ff(float) #1
+
+; Function Attrs: nounwind
+define void @vft() #0 {
+entry:
+ %0 = load float* @x, align 4
+ call void @vf(float %0)
+ ret void
+; PIC: .ent vft
+; STATIC: .ent vft
+; PIC: save $16, $ra, [[FS:[0-9]+]]
+; STATIC: save $16, $ra, [[FS:[0-9]+]]
+; PIC: restore $16, $ra, [[FS]]
+; STATIC: restore $16, $ra, [[FS]]
+; PIC: .end vft
+; STATIC: .end vft
+}
+
+declare void @vf(float) #1
+
+attributes #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" }
+attributes #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" }
+
+