Files
clang-p2996/llvm/test/CodeGen/PowerPC/test_func_desc.ll
jasonliu 51e6fc44d0 [XCOFF][AIX] Emit correct alignment for csect
Summary:
This patch tries to emit the correct alignment result for both
object file generation path and assembly path.

Reviewed by: hubert.reinterpretcast, DiggerLin, daltenty

Differential Revision: https://reviews.llvm.org/D79127
2020-05-11 19:43:10 +00:00

75 lines
1.6 KiB
LLVM

; RUN: llc -mtriple powerpc-ibm-aix-xcoff < %s | \
; RUN: FileCheck --check-prefixes=CHECK,32BIT %s
; RUN: llc -mtriple powerpc64-ibm-aix-xcoff < %s | \
; RUN: FileCheck --check-prefixes=CHECK,64BIT %s
define i32 @foo() {
entry:
ret i32 3
}
define i32 @main() {
entry:
%0 = call i32 @foo()
%1 = call i32 bitcast (i32 (...)* @extern_foo to i32 ()*)()
%2 = call i32 @static_foo()
%3 = add nsw i32 %0, %1
%4 = add nsw i32 %3, %2
ret i32 %4
}
declare i32 @extern_foo(...)
define internal i32 @static_foo() {
entry:
ret i32 3
}
; CHECK: .globl foo[DS]
; CHECK: .globl .foo
; 32BIT: .csect foo[DS], 2
; 32BIT-NEXT: .long .foo
; 32BIT-NEXT: .long TOC[TC0]
; 32BIT-NEXT: .long 0
; 64BIT: .csect foo[DS], 3
; 64BIT-NEXT: .llong .foo
; 64BIT-NEXT: .llong TOC[TC0]
; 64BIT-NEXT: .llong 0
; CHECK-NEXT: .csect .text[PR], 2
; CHECK-LABEL: .foo:
; CHECK: .globl main[DS]
; CHECK: .globl .main
; 32BIT: .csect main[DS], 2
; 32BIT-NEXT: .long .main
; 32BIT-NEXT: .long TOC[TC0]
; 32BIT-NEXT: .long 0
; 64BIT: .csect main[DS], 3
; 64BIT-NEXT: .llong .main
; 64BIT-NEXT: .llong TOC[TC0]
; 64BIT-NEXT: .llong 0
; CHECK-NEXT: .csect .text[PR], 2
; CHECK-LABEL: .main:
; CHECK: bl .foo
; CHECK: bl .extern_foo
; CHECK: bl .static_foo
; CHECK: .lglobl .static_foo
; 32BIT: .csect static_foo[DS], 2
; 32BIT-NEXT: .long .static_foo
; 32BIT-NEXT: .long TOC[TC0]
; 32BIT-NEXT: .long 0
; 64BIT: .csect static_foo[DS], 3
; 64BIT-NEXT: .llong .static_foo
; 64BIT-NEXT: .llong TOC[TC0]
; 64BIT-NEXT: .llong 0
; CHECK-NEXT: .csect .text[PR], 2
; CHECK-LABEL: .static_foo:
; CHECK-NOT: .csect extern_foo
; CHECK: .toc
; CHECK-NOT: .tc