1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00
llvm-mirror/test/CodeGen/PowerPC/aix-func-dsc-gen.ll
diggerlin fd7184191d [AIX] discard the label in the csect of function description and use qualname for linkage
SUMMARY:

SUMMARY
for a source file  "test.c"

void foo() {};

llc will generate assembly code as (assembly patch)
     .globl  foo
     .globl  .foo
     .csect foo[DS]
foo:

        .long   .foo
        .long   TOC[TC0]
        .long   0

   and symbol table as (xcoff object file)
   [4]     m   0x00000004     .data     1  unamex                    foo
   [5]     a4  0x0000000c       0    0     SD       DS    0    0
   [6]     m   0x00000004     .data     1  extern                    foo
   [7]     a4  0x00000004       0    0     LD       DS    0    0

   After first patch, the assembly will be as

        .globl  foo[DS]                 # -- Begin function foo
        .globl  .foo
        .align  2
        .csect foo[DS]
        .long   .foo
        .long   TOC[TC0]
        .long   0

    and symbol table will as
   [6]     m   0x00000004     .data     1  extern                    foo
   [7]     a4  0x00000004       0    0     DS      DS    0    0
Change the code for the assembly path and xcoff objectfile patch for llc.

Reviewers: Jason Liu
Subscribers: wuzish, nemanjai, hiraditya

Differential Revision: https://reviews.llvm.org/D76162
2020-03-26 15:46:52 -04:00

93 lines
3.3 KiB
LLVM

; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc-ibm-aix-xcoff -filetype=obj -o %t.o < %s
; RUN: llvm-readobj --symbols %t.o | FileCheck %s
define void @foo() {
entry:
ret void
}
; CHECK: File: {{.*}}aix-func-dsc-gen.ll.tmp.o
; CHECK-NEXT: Format: aixcoff-rs6000
; CHECK-NEXT: Arch: powerpc
; CHECK-NEXT: AddressSize: 32bit
; CHECK: Symbol {
; CHECK-NEXT: Index: [[#Index:]]
; CHECK-NEXT: Name: .text
; CHECK-NEXT: Value (RelocatableAddress): 0x0
; CHECK-NEXT: Section: .text
; CHECK-NEXT: Type: 0x0
; CHECK-NEXT: StorageClass: C_HIDEXT (0x6B)
; CHECK-NEXT: NumberOfAuxEntries: 1
; CHECK-NEXT: CSECT Auxiliary Entry {
; CHECK-NEXT: Index: [[#Index+1]]
; CHECK-NEXT: SectionLen: 4
; CHECK-NEXT: ParameterHashIndex: 0x0
; CHECK-NEXT: TypeChkSectNum: 0x0
; CHECK-NEXT: SymbolAlignmentLog2: 4
; CHECK-NEXT: SymbolType: XTY_SD (0x1)
; CHECK-NEXT: StorageMappingClass: XMC_PR (0x0)
; CHECK-NEXT: StabInfoIndex: 0x0
; CHECK-NEXT: StabSectNum: 0x0
; CHECK-NEXT: }
; CHECK-NEXT: }
; CHECK-NEXT: Symbol {
; CHECK-NEXT: Index: [[#Index+2]]
; CHECK-NEXT: Name: .foo
; CHECK-NEXT: Value (RelocatableAddress): 0x0
; CHECK-NEXT: Section: .text
; CHECK-NEXT: Type: 0x0
; CHECK-NEXT: StorageClass: C_EXT (0x2)
; CHECK-NEXT: NumberOfAuxEntries: 1
; CHECK-NEXT: CSECT Auxiliary Entry {
; CHECK-NEXT: Index: [[#Index+3]]
; CHECK-NEXT: ContainingCsectSymbolIndex: [[#Index]]
; CHECK-NEXT: ParameterHashIndex: 0x0
; CHECK-NEXT: TypeChkSectNum: 0x0
; CHECK-NEXT: SymbolAlignmentLog2: 0
; CHECK-NEXT: SymbolType: XTY_LD (0x2)
; CHECK-NEXT: StorageMappingClass: XMC_PR (0x0)
; CHECK-NEXT: StabInfoIndex: 0x0
; CHECK-NEXT: StabSectNum: 0x0
; CHECK-NEXT: }
; CHECK-NEXT: }
; CHECK-NEXT: Symbol {
; CHECK-NEXT: Index: [[#Index+4]]
; CHECK-NEXT: Name: foo
; CHECK-NEXT: Value (RelocatableAddress): 0x4
; CHECK-NEXT: Section: .data
; CHECK-NEXT: Type: 0x0
; CHECK-NEXT: StorageClass: C_EXT (0x2)
; CHECK-NEXT: NumberOfAuxEntries: 1
; CHECK-NEXT: CSECT Auxiliary Entry {
; CHECK-NEXT: Index: [[#Index+5]]
; CHECK-NEXT: SectionLen: 12
; CHECK-NEXT: ParameterHashIndex: 0x0
; CHECK-NEXT: TypeChkSectNum: 0x0
; CHECK-NEXT: SymbolAlignmentLog2: 2
; CHECK-NEXT: SymbolType: XTY_SD (0x1)
; CHECK-NEXT: StorageMappingClass: XMC_DS (0xA)
; CHECK-NEXT: StabInfoIndex: 0x0
; CHECK-NEXT: StabSectNum: 0x0
; CHECK-NEXT: }
; CHECK-NEXT: }
; CHECK-NEXT: Symbol {
; CHECK-NEXT: Index: [[#Index+6]]
; CHECK-NEXT: Name: TOC
; CHECK-NEXT: Value (RelocatableAddress): 0x10
; CHECK-NEXT: Section: .data
; CHECK-NEXT: Type: 0x0
; CHECK-NEXT: StorageClass: C_HIDEXT (0x6B)
; CHECK-NEXT: NumberOfAuxEntries: 1
; CHECK-NEXT: CSECT Auxiliary Entry {
; CHECK-NEXT: Index: [[#Index+7]]
; CHECK-NEXT: SectionLen: 0
; CHECK-NEXT: ParameterHashIndex: 0x0
; CHECK-NEXT: TypeChkSectNum: 0x0
; CHECK-NEXT: SymbolAlignmentLog2: 2
; CHECK-NEXT: SymbolType: XTY_SD (0x1)
; CHECK-NEXT: StorageMappingClass: XMC_TC0 (0xF)
; CHECK-NEXT: StabInfoIndex: 0x0
; CHECK-NEXT: StabSectNum: 0x0
; CHECK-NEXT: }
; CHECK-NEXT: }