mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-26 05:36:36 +00:00

For historic reasons, the behavior of .align differs between targets. Fortunately, there are alternatives, .p2align and .balign, which make the interpretation of the parameter explicit, and which behave consistently across targets. This patch teaches MC to use .p2align instead of .align, so that people reading code for multiple architectures don't have to remember which way each platform does its .align directive. Differential Revision: http://reviews.llvm.org/D16549 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258750 91177308-0d34-0410-b5e6-96231b3b80d8
26 lines
937 B
LLVM
26 lines
937 B
LLVM
; RUN: llc -mtriple=x86_64-linux-gnu < %s | FileCheck %s --check-prefix=CHECK64
|
|
; RUN: llc -mtriple=i686-linux-gnu < %s | FileCheck %s --check-prefix=CHECK32
|
|
|
|
define i32 @main(i32 %x) nounwind gc "erlang" {
|
|
%puts = tail call i32 @foo(i32 %x)
|
|
ret i32 0
|
|
|
|
; CHECK64: .section .note.gc,"",@progbits
|
|
; CHECK64-NEXT: .p2align 3
|
|
; CHECK64-NEXT: .short 1 # safe point count
|
|
; CHECK64-NEXT: .long .Ltmp0 # safe point address
|
|
; CHECK64-NEXT: .short 1 # stack frame size (in words)
|
|
; CHECK64-NEXT: .short 0 # stack arity
|
|
; CHECK64-NEXT: .short 0 # live root count
|
|
|
|
; CHECK32: .section .note.gc,"",@progbits
|
|
; CHECK32-NEXT: .p2align 2
|
|
; CHECK32-NEXT: .short 1 # safe point count
|
|
; CHECK32-NEXT: .long .Ltmp0 # safe point address
|
|
; CHECK32-NEXT: .short 3 # stack frame size (in words)
|
|
; CHECK32-NEXT: .short 0 # stack arity
|
|
; CHECK32-NEXT: .short 0 # live root count
|
|
}
|
|
|
|
declare i32 @foo(i32)
|