forked from OSchip/llvm-project
34 lines
1.5 KiB
LLVM
34 lines
1.5 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
|
|
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -amdgpu-annotate-kernel-features %s | FileCheck -check-prefix=GCN %s
|
|
|
|
define internal void @indirect() {
|
|
; GCN-LABEL: define {{[^@]+}}@indirect
|
|
; GCN-SAME: () #[[ATTR0:[0-9]+]] {
|
|
; GCN-NEXT: ret void
|
|
;
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_kernel void @test_simple_indirect_call() #0 {
|
|
; GCN-LABEL: define {{[^@]+}}@test_simple_indirect_call
|
|
; GCN-SAME: () #[[ATTR1:[0-9]+]] {
|
|
; GCN-NEXT: [[FPTR:%.*]] = alloca void ()*, align 8
|
|
; GCN-NEXT: store void ()* @indirect, void ()** [[FPTR]], align 8
|
|
; GCN-NEXT: [[FP:%.*]] = load void ()*, void ()** [[FPTR]], align 8
|
|
; GCN-NEXT: call void [[FP]]()
|
|
; GCN-NEXT: ret void
|
|
;
|
|
%fptr = alloca void()*
|
|
store void()* @indirect, void()** %fptr
|
|
%fp = load void()*, void()** %fptr
|
|
call void %fp()
|
|
ret void
|
|
}
|
|
|
|
attributes #0 = { "amdgpu-dispatch-id" }
|
|
|
|
;.
|
|
; GCN: attributes #[[ATTR0]] = { "amdgpu-dispatch-id" "amdgpu-dispatch-ptr" "amdgpu-implicitarg-ptr" "amdgpu-queue-ptr" "amdgpu-work-group-id-x" "amdgpu-work-group-id-y" "amdgpu-work-group-id-z" "amdgpu-work-item-id-x" "amdgpu-work-item-id-y" "amdgpu-work-item-id-z" }
|
|
; GCN: attributes #[[ATTR1]] = { "amdgpu-calls" "amdgpu-dispatch-id" "amdgpu-dispatch-ptr" "amdgpu-implicitarg-ptr" "amdgpu-queue-ptr" "amdgpu-stack-objects" "amdgpu-work-group-id-x" "amdgpu-work-group-id-y" "amdgpu-work-group-id-z" "amdgpu-work-item-id-x" "amdgpu-work-item-id-y" "amdgpu-work-item-id-z" }
|
|
;.
|