1 ; RUN: opt -S -mtriple=amdgcn-- -amdgpu-lower-ctor-dtor < %s | FileCheck %s
3 @llvm.global_ctors = appending addrspace(1) global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 1, void ()* @foo, i8* null }, { i32, void ()*, i8* } { i32 1, void ()* @foo.5, i8* null }]
4 @llvm.global_dtors = appending addrspace(1) global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 1, void ()* @bar, i8* null }, { i32, void ()*, i8* } { i32 1, void ()* @bar.5, i8* null }]
6 ; CHECK-LABEL: amdgpu_kernel void @amdgcn.device.init() #0
7 ; CHECK-NEXT: call void @foo
8 ; CHECK-NEXT: call void @foo.5
10 ; CHECK-LABEL: amdgpu_kernel void @amdgcn.device.fini() #1
11 ; CHECK-NEXT: call void @bar
12 ; CHECK-NEXT: call void @bar.5
14 define internal void @foo() {
18 define internal void @bar() {
22 define internal void @foo.5() {
26 define internal void @bar.5() {
30 ; CHECK: attributes #0 = { "device-init" }
31 ; CHECK: attributes #1 = { "device-fini" }