[clang] Fix crashes when passing VLA to va_arg (#119563)
[llvm-project.git] / llvm / test / CodeGen / AMDGPU / uniform-work-group-nested-function-calls.ll
blob9fe753fec0f9135b783ac4912af2301dc229da1a
1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
2 ; RUN: opt -S -mtriple=amdgcn-amd- -passes=amdgpu-attributor < %s | FileCheck %s
4 ; Test to verify if the attribute gets propagated across nested function calls
6 ; Added to prevent Attributor from deleting calls.
7 @x = global i32 0
9 ;.
10 ; CHECK: @x = global i32 0
12 define void @func1() #0 {
13 ; CHECK-LABEL: define {{[^@]+}}@func1
14 ; CHECK-SAME: () #[[ATTR0:[0-9]+]] {
15 ; CHECK-NEXT:    store i32 0, ptr @x, align 4
16 ; CHECK-NEXT:    ret void
18   store i32 0, ptr @x
19   ret void
22 define void @func2() #1 {
23 ; CHECK-LABEL: define {{[^@]+}}@func2
24 ; CHECK-SAME: () #[[ATTR0]] {
25 ; CHECK-NEXT:    call void @func1()
26 ; CHECK-NEXT:    ret void
28   call void @func1()
29   ret void
32 define amdgpu_kernel void @kernel3() #2 {
33 ; CHECK-LABEL: define {{[^@]+}}@kernel3
34 ; CHECK-SAME: () #[[ATTR1:[0-9]+]] {
35 ; CHECK-NEXT:    call void @func2()
36 ; CHECK-NEXT:    ret void
38   call void @func2()
39   ret void
42 attributes #2 = { "uniform-work-group-size"="true" }
44 ; CHECK: attributes #[[ATTR0]] = { "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-flat-scratch-init" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "uniform-work-group-size"="false" }
45 ; CHECK: attributes #[[ATTR1]] = { "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-flat-scratch-init" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "uniform-work-group-size"="true" }