summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorReed Kotler <rkotler@mips.com>2013-11-13 23:52:18 +0000
committerReed Kotler <rkotler@mips.com>2013-11-13 23:52:18 +0000
commit5aeb5e530e11a1473ecddb126b72cd4e37fada81 (patch)
tree0e6a45897ef5161dc37cec6b392ba30d51c6b7de /test
parenta2b4eb6d15a13de257319ac6231b5ab622cd02b1 (diff)
downloadllvm-5aeb5e530e11a1473ecddb126b72cd4e37fada81.tar.gz
llvm-5aeb5e530e11a1473ecddb126b72cd4e37fada81.tar.bz2
llvm-5aeb5e530e11a1473ecddb126b72cd4e37fada81.tar.xz
Take care of long short branch immediate instructions for mips16 in
constant islands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194630 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/Mips/brsize3.ll33
-rw-r--r--test/CodeGen/Mips/brsize3a.ll26
2 files changed, 59 insertions, 0 deletions
diff --git a/test/CodeGen/Mips/brsize3.ll b/test/CodeGen/Mips/brsize3.ll
new file mode 100644
index 0000000000..7b1f44001a
--- /dev/null
+++ b/test/CodeGen/Mips/brsize3.ll
@@ -0,0 +1,33 @@
+; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=mips16 -soft-float -mips16-hard-float -relocation-model=pic -mips16-constant-islands < %s | FileCheck %s -check-prefix=b-no-short
+
+; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=mips16 -soft-float -mips16-hard-float -relocation-model=pic -mips16-constant-islands < %s | FileCheck %s -check-prefix=b-long
+
+; ModuleID = 'brsize3.c'
+target datalayout = "E-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32-S64"
+target triple = "mips--linux-gnu"
+
+; Function Attrs: noreturn nounwind optsize
+define void @foo() #0 {
+entry:
+ br label %x
+
+x: ; preds = %x, %entry
+ tail call void asm sideeffect ".space 60000", ""() #1, !srcloc !1
+ br label %x
+; b-long: $BB0_1:
+; b-long: #APP
+; b-long: .space 60000
+; b-long: #NO_APP
+; b-long: b $BB0_1
+; b-no-short: $BB0_1:
+; b-no-short: #APP
+; b-no-short: .space 60000
+; b-no-short: #NO_APP
+; b-no-short-NOT: b $BB0_1 # 16 bit inst
+
+}
+
+attributes #0 = { noreturn nounwind optsize "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="true" }
+attributes #1 = { nounwind }
+
+!1 = metadata !{i32 45}
diff --git a/test/CodeGen/Mips/brsize3a.ll b/test/CodeGen/Mips/brsize3a.ll
new file mode 100644
index 0000000000..6382fa228e
--- /dev/null
+++ b/test/CodeGen/Mips/brsize3a.ll
@@ -0,0 +1,26 @@
+; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=mips16 -soft-float -mips16-hard-float -relocation-model=pic -mips16-constant-islands < %s | FileCheck %s -check-prefix=b-short
+
+; ModuleID = 'brsize3.c'
+target datalayout = "E-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32-S64"
+target triple = "mips--linux-gnu"
+
+; Function Attrs: noreturn nounwind optsize
+define void @foo() #0 {
+entry:
+ br label %x
+
+x: ; preds = %x, %entry
+ tail call void asm sideeffect ".space 200", ""() #1, !srcloc !1
+ br label %x
+; b-short: $BB0_1:
+; b-short: #APP
+; b-short: .space 200
+; b-short: #NO_APP
+; b-short: b $BB0_1 # 16 bit inst
+
+}
+
+attributes #0 = { noreturn nounwind optsize "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="true" }
+attributes #1 = { nounwind }
+
+!1 = metadata !{i32 45}