[PATCH] D71845: [AIX][XCOFF] add test for raw text section content and test section header
Digger via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 23 10:50:13 PST 2019
DiggerLin created this revision.
DiggerLin added reviewers: hubert.reinterpretcast, jasonliu, sfertile, daltenty.
Herald added subscribers: llvm-commits, jsji, nemanjai.
Herald added a project: LLVM.
as discussed in the patch https://reviews.llvm.org/D66969,
since implemented the function description. We can output the raw object data for function.
we need to create a test for raw text section content and test section header for xcoff object file.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D71845
Files:
llvm/test/CodeGen/PowerPC/aix-return55.ll
Index: llvm/test/CodeGen/PowerPC/aix-return55.ll
===================================================================
--- llvm/test/CodeGen/PowerPC/aix-return55.ll
+++ llvm/test/CodeGen/PowerPC/aix-return55.ll
@@ -1,5 +1,7 @@
-; RUN: llc -mcpu=pwr9 -mtriple=powerpc-ibm-aix-xcoff -verify-machineinstrs < %s | FileCheck %s
-
+; RUN: llc -mcpu=pwr4 -mtriple=powerpc-ibm-aix-xcoff -verify-machineinstrs < %s | FileCheck %s
+; RUN: llc -mcpu=pwr4 -mtriple=powerpc-ibm-aix-xcoff -verify-machineinstrs -filetype=obj -o %t.o < %s
+; RUN: llvm-objdump -D %t.o | FileCheck --check-prefix=CHECKOBJ %s
+; RUN: llvm-readobj -sections %t.o | FileCheck --check-prefix=CHECKSECT %s
define dso_local signext i32 @foo() {
entry:
@@ -9,3 +11,35 @@
; CHECK: blr
}
+;CHECKOBJ: 00000000 .text:
+;CHECKOBJ-NEXT: 0: 38 60 00 37 li 3, 55
+;CHECKOBJ-NEXT: 4: 4e 80 00 20 blr
+
+;CHECKSECT: Sections [
+;CHECKSECT-NEXT: Section {
+;CHECKSECT-NEXT: Index: 1
+;CHECKSECT-NEXT: Name: .text
+;CHECKSECT-NEXT: PhysicalAddress: 0x0
+;CHECKSECT-NEXT: VirtualAddress: 0x0
+;CHECKSECT-NEXT: Size: 0x8
+;CHECKSECT-NEXT: RawDataOffset: 0x64
+;CHECKSECT-NEXT: RelocationPointer: 0x0
+;CHECKSECT-NEXT: LineNumberPointer: 0x0
+;CHECKSECT-NEXT: NumberOfRelocations: 0
+;CHECKSECT-NEXT: NumberOfLineNumbers: 0
+;CHECKSECT-NEXT: Type: STYP_TEXT (0x20)
+;CHECKSECT-NEXT: }
+;CHECKSECT-NEXT: Section {
+;CHECKSECT-NEXT: Index: 2
+;CHECKSECT-NEXT: Name: .data
+;CHECKSECT-NEXT: PhysicalAddress: 0x8
+;CHECKSECT-NEXT: VirtualAddress: 0x8
+;CHECKSECT-NEXT: Size: 0xC
+;CHECKSECT-NEXT: RawDataOffset: 0x6C
+;CHECKSECT-NEXT: RelocationPointer: 0x0
+;CHECKSECT-NEXT: LineNumberPointer: 0x0
+;CHECKSECT-NEXT: NumberOfRelocations: 0
+;CHECKSECT-NEXT: NumberOfLineNumbers: 0
+;CHECKSECT-NEXT: Type: STYP_DATA (0x40)
+;CHECKSECT-NEXT: }
+;CHECKSECT-NEXT: ]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71845.235164.patch
Type: text/x-patch
Size: 1960 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191223/68ce8aa4/attachment.bin>
More information about the llvm-commits
mailing list