[llvm] 0cc124c - [llvm-objdump][test] Improve PowerPC branch offset tests
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 23 00:08:19 PDT 2020
Author: Fangrui Song
Date: 2020-03-23T00:07:21-07:00
New Revision: 0cc124c186a5211ae5a734fe7708d61b5a150bc2
URL: https://github.com/llvm/llvm-project/commit/0cc124c186a5211ae5a734fe7708d61b5a150bc2
DIFF: https://github.com/llvm/llvm-project/commit/0cc124c186a5211ae5a734fe7708d61b5a150bc2.diff
LOG: [llvm-objdump][test] Improve PowerPC branch offset tests
Added:
Modified:
llvm/test/tools/llvm-objdump/ELF/PowerPC/branch-offset.s
Removed:
################################################################################
diff --git a/llvm/test/tools/llvm-objdump/ELF/PowerPC/branch-offset.s b/llvm/test/tools/llvm-objdump/ELF/PowerPC/branch-offset.s
index 38588a3774cb..e78e4c16eab5 100644
--- a/llvm/test/tools/llvm-objdump/ELF/PowerPC/branch-offset.s
+++ b/llvm/test/tools/llvm-objdump/ELF/PowerPC/branch-offset.s
@@ -1,43 +1,35 @@
-# RUN: llvm-mc -triple=powerpc64le-unknown-linux -filetype=obj %s -o %t.o
-# RUN: llvm-objdump -d %t.o | FileCheck %s
-
-# RUN: llvm-mc -triple=powerpc64-unknown-linux -filetype=obj %s -o %t.o
-# RUN: llvm-objdump -d %t.o | FileCheck %s
-
-# RUN: llvm-mc -triple=powerpc-unknown-linux -filetype=obj %s -o %t.o
-# RUN: llvm-objdump -d %t.o | FileCheck %s
-
-# CHECK: {{0*}}00000000 <callee_back>:
-# CHECK: 18: {{.*}} bl .-24
-# CHECK: 20: {{.*}} bl .+16
-# CHECK: {{0*}}00000030 <callee_forward>:
-
- .text
- .global caller
- .type caller, at function
- .type callee_forward, at function
- .type callee_back, at function
-
- .p2align 4
-callee_back:
- li 3, 55
- blr
-
- .p2align 4
-caller:
-.Lgep:
- addis 2, 12, .TOC.-.Lgep at ha
- addi 2, 2, .TOC.-.Lgep at l
-.Llep:
- .localentry caller, .Llep-.Lgep
- bl callee_back
- mr 31, 3
- bl callee_forward
- add 3, 3, 31
- blr
-
- .p2align 4
-callee_forward:
- li 3, 66
- blr
+# RUN: llvm-mc -triple=powerpc -filetype=obj %s -o %t.32.o
+# RUN: llvm-objdump -d --no-show-raw-insn %t.32.o | FileCheck --check-prefixes=ELF32,CHECK %s
+# RUN: llvm-mc -triple=powerpc64le -filetype=obj %s -o %t.64.o
+# RUN: llvm-objdump -d --no-show-raw-insn %t.64.o | FileCheck --check-prefixes=ELF64,CHECK %s
+
+# RUN: llvm-mc -triple=powerpc64 -filetype=obj %s -o %t.64.o
+# RUN: llvm-objdump -d --no-show-raw-insn %t.64.o | FileCheck --check-prefixes=ELF64,CHECK %s
+
+# CHECK-LABEL: <bl>:
+# ELF32-NEXT: bl .-4
+# ELF64-NEXT: bl .-4
+# CHECK-NEXT: bl .+0
+# CHECK-NEXT: bl .+4
+
+bl:
+ bl .-4
+ bl .
+ bl .+4
+
+# CHECK-LABEL: <b>:
+# CHECK-NEXT: b .+67108860
+# CHECK-NEXT: b .+0
+# CHECK-NEXT: b .+4
+
+b:
+ b .-4
+ b .
+ b .+4
+
+# CHECK-LABEL: <bt>:
+# CHECK-NEXT: bt 2, .+65532
+
+bt:
+ bt 2, .-4
More information about the llvm-commits
mailing list