aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/MIR/X86/null-register-operands.mir
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/MIR/X86/null-register-operands.mir')
-rw-r--r--test/CodeGen/MIR/X86/null-register-operands.mir24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/CodeGen/MIR/X86/null-register-operands.mir b/test/CodeGen/MIR/X86/null-register-operands.mir
new file mode 100644
index 0000000000000..55c0ceb3a60a3
--- /dev/null
+++ b/test/CodeGen/MIR/X86/null-register-operands.mir
@@ -0,0 +1,24 @@
+# RUN: llc -march=x86-64 -start-after branch-folder -stop-after branch-folder -o /dev/null %s | FileCheck %s
+# This test ensures that the MIR parser parses null register operands correctly.
+
+--- |
+
+ define i32 @deref(i32* %p) {
+ entry:
+ %a = load i32, i32* %p
+ ret i32 %a
+ }
+
+...
+---
+# CHECK: name: deref
+name: deref
+body:
+ - id: 0
+ name: entry
+ instructions:
+ # CHECK: - '%eax = MOV32rm %rdi, 1, _, 0, _'
+ # CHECK-NEXT: - 'RETQ %eax'
+ - '%eax = MOV32rm %rdi, 1, _, 0, %noreg'
+ - 'RETQ %eax'
+...