[PowerPC][NFC] add test case for mflr store fix
authorChen Zheng <czhengsz@cn.ibm.com>
Tue, 22 Nov 2022 07:17:20 +0000 (07:17 +0000)
committerChen Zheng <czhengsz@cn.ibm.com>
Tue, 22 Nov 2022 07:25:23 +0000 (07:25 +0000)
llvm/test/CodeGen/PowerPC/mflr-store.mir [new file with mode: 0644]

diff --git a/llvm/test/CodeGen/PowerPC/mflr-store.mir b/llvm/test/CodeGen/PowerPC/mflr-store.mir
new file mode 100644 (file)
index 0000000..916a430
--- /dev/null
@@ -0,0 +1,38 @@
+# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
+# RUN: llc -mtriple powerpc64-unknown-aix-xcoff -x mir \
+# RUN: -stop-after=prologepilog --verify-machineinstrs < %s | \
+# RUN: FileCheck %s --check-prefixes=CHECK
+
+---
+name:            test_callee
+frameInfo:
+  hasCalls:        true
+tracksRegLiveness: true
+body: |
+  bb.0:
+    ; CHECK-LABEL: name: test_callee
+    ; CHECK: $x3 = LI8 10
+    ; CHECK-NEXT: BLR8 implicit $lr8, implicit $rm, implicit killed $x3
+    $x3 = LI8 10
+    BLR8 implicit $lr8, implicit $rm, implicit killed $x3
+...
+---
+name:            test
+tracksRegLiveness: true
+stack:
+  - { id: 0, size: 32704, alignment: 8 }
+body: |
+  bb.0:
+    ; CHECK-LABEL: name: test
+    ; CHECK: $x0 = MFLR8 implicit $lr8
+    ; CHECK-NEXT: $x1 = STDU $x1, -32752, $x1
+    ; CHECK-NEXT: STD killed $x0, 32768, $x1
+    ; CHECK-NEXT: BL8 @test_callee, csr_ppc64, implicit-def dead $lr8, implicit $rm, implicit $x2, implicit-def $r1, implicit-def $x3
+    ; CHECK-NEXT: $x1 = ADDI8 $x1, 32752
+    ; CHECK-NEXT: $x0 = LD 16, $x1
+    ; CHECK-NEXT: MTLR8 $x0, implicit-def $lr8
+    ; CHECK-NEXT: BLR8 implicit $lr8, implicit $rm, implicit killed $x3
+    BL8 @test_callee, csr_ppc64, implicit-def dead $lr8, implicit $rm, implicit $x2, implicit-def $r1, implicit-def $x3
+    BLR8 implicit $lr8, implicit $rm, implicit $x3
+...
+