1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/CodeGen/PowerPC/aix-static-init-default-priority.ll
Xiangling Liao 0a11ef2eea [AIX] Static init frontend recovery and backend support
On the frontend side, this patch recovers AIX static init implementation to
use the linkage type and function names Clang chooses for sinit related function.

On the backend side, this patch sets correct linkage and function names on aliases
created for sinit/sterm functions.

Differential Revision: https://reviews.llvm.org/D84534
2020-08-10 10:10:49 -04:00

61 lines
2.4 KiB
LLVM

; RUN: llc -mtriple powerpc-ibm-aix-xcoff < %s | FileCheck %s
; RUN: llc -mtriple powerpc64-ibm-aix-xcoff < %s | FileCheck %s
@llvm.global_ctors = appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init1, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @init2, i8* null }]
@llvm.global_dtors = appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @destruct1, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @destruct2, i8* null }]
define i32 @extFunc() {
entry:
ret i32 3
}
define internal void @init1() {
ret void
}
define internal void @destruct1() {
ret void
}
define internal void @init2() {
ret void
}
define internal void @destruct2() {
ret void
}
; CHECK: .lglobl init1[DS]
; CHECK: .lglobl .init1
; CHECK: .csect init1[DS]
; CHECK: __sinit80000000_clang_ac404299654d2af7eae71e75c17f7c9b_0: # @init1
; CHECK: .init1:
; CHECK: .__sinit80000000_clang_ac404299654d2af7eae71e75c17f7c9b_0:
; CHECK: .lglobl destruct1[DS]
; CHECK: .lglobl .destruct1
; CHECK: .csect destruct1[DS]
; CHECK: __sterm80000000_clang_ac404299654d2af7eae71e75c17f7c9b_0: # @destruct1
; CHECK: .destruct1:
; CHECK: .__sterm80000000_clang_ac404299654d2af7eae71e75c17f7c9b_0:
; CHECK: .lglobl init2[DS]
; CHECK: .lglobl .init2
; CHECK: .csect init2[DS]
; CHECK: __sinit80000000_clang_ac404299654d2af7eae71e75c17f7c9b_1: # @init2
; CHECK: .init2:
; CHECK: .__sinit80000000_clang_ac404299654d2af7eae71e75c17f7c9b_1:
; CHECK: .lglobl destruct2[DS]
; CHECK: .lglobl .destruct2
; CHECK: .csect destruct2[DS]
; CHECK: __sterm80000000_clang_ac404299654d2af7eae71e75c17f7c9b_1: # @destruct2
; CHECK: .destruct2:
; CHECK: .__sterm80000000_clang_ac404299654d2af7eae71e75c17f7c9b_1:
; CHECK: .globl __sinit80000000_clang_ac404299654d2af7eae71e75c17f7c9b_0
; CHECK: .globl .__sinit80000000_clang_ac404299654d2af7eae71e75c17f7c9b_0
; CHECK: .globl __sinit80000000_clang_ac404299654d2af7eae71e75c17f7c9b_1
; CHECK: .globl .__sinit80000000_clang_ac404299654d2af7eae71e75c17f7c9b_1
; CHECK: .globl __sterm80000000_clang_ac404299654d2af7eae71e75c17f7c9b_0
; CHECK: .globl .__sterm80000000_clang_ac404299654d2af7eae71e75c17f7c9b_0
; CHECK: .globl __sterm80000000_clang_ac404299654d2af7eae71e75c17f7c9b_1
; CHECK: .globl .__sterm80000000_clang_ac404299654d2af7eae71e75c17f7c9b_1