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