summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/test/CodeGen/X86/GlobalISel/select-constant.mir21
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/GlobalISel/select-constant.mir b/llvm/test/CodeGen/X86/GlobalISel/select-constant.mir
index 7902a5084ce..4b91b5f9f09 100644
--- a/llvm/test/CodeGen/X86/GlobalISel/select-constant.mir
+++ b/llvm/test/CodeGen/X86/GlobalISel/select-constant.mir
@@ -13,6 +13,10 @@
ret i32 4
}
+ define i32 @const_i32_0() {
+ ret i32 0
+ }
+
define i64 @const_i64() {
ret i64 68719476720
}
@@ -84,6 +88,23 @@ body: |
...
---
+name: const_i32_0
+# CHECK-LABEL: name: const_i32_0
+legalized: true
+regBankSelected: true
+# CHECK: registers:
+# CHECK-NEXT: - { id: 0, class: gr32, preferred-register: '' }
+registers:
+ - { id: 0, class: gpr }
+# CHECK: %0 = MOV32r0 implicit-def %eflags
+body: |
+ bb.1 (%ir-block.0):
+ %0(s32) = G_CONSTANT i32 0
+ %eax = COPY %0(s32)
+ RET 0, implicit %eax
+
+...
+---
name: const_i64
legalized: true
regBankSelected: true
OpenPOWER on IntegriCloud