summaryrefslogtreecommitdiff
path: root/test/MC/Mips/sext_64_32.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/MC/Mips/sext_64_32.ll')
-rw-r--r--test/MC/Mips/sext_64_32.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/MC/Mips/sext_64_32.ll b/test/MC/Mips/sext_64_32.ll
new file mode 100644
index 0000000000000..e5c57b8c41d8c
--- /dev/null
+++ b/test/MC/Mips/sext_64_32.ll
@@ -0,0 +1,20 @@
+; RUN: llc -march=mips64el -filetype=obj -mcpu=mips64r2 %s -o - | llvm-objdump -disassemble -triple mips64el - | FileCheck %s
+
+; Sign extend from 32 to 64 was creating nonsense opcodes
+
+; CHECK: sll ${{[0-9]+}}, ${{[0-9]+}}, 0
+
+define i64 @foo(i32 %ival) nounwind readnone {
+entry:
+ %conv = sext i32 %ival to i64
+ ret i64 %conv
+}
+
+; CHECK: dsll32 ${{[0-9]+}}, ${{[0-9]+}}, 0
+
+define i64 @foo_2(i32 %ival_2) nounwind readnone {
+entry:
+ %conv_2 = zext i32 %ival_2 to i64
+ ret i64 %conv_2
+}
+