1 // RUN: %clang_cc1 -triple amdgcn-- -target-cpu tahiti -O0 -emit-llvm -o - %s | FileCheck %s 2 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -O0 -emit-llvm -verify -o - %s | FileCheck -check-prefix=X86 %s 3 4 // Make sure this is silently accepted on other targets. 5 6 __attribute__((amdgpu_num_vgpr(64))) // expected-no-diagnostics 7 kernel void test_num_vgpr64() { 8 // CHECK: define amdgpu_kernel void @test_num_vgpr64() [[ATTR_VGPR64:#[0-9]+]] 9 } 10 11 __attribute__((amdgpu_num_sgpr(32))) // expected-no-diagnostics 12 kernel void test_num_sgpr32() { 13 // CHECK: define amdgpu_kernel void @test_num_sgpr32() [[ATTR_SGPR32:#[0-9]+]] 14 } 15 16 __attribute__((amdgpu_num_vgpr(64), amdgpu_num_sgpr(32))) // expected-no-diagnostics 17 kernel void test_num_vgpr64_sgpr32() { 18 // CHECK: define amdgpu_kernel void @test_num_vgpr64_sgpr32() [[ATTR_VGPR64_SGPR32:#[0-9]+]] 19 20 } 21 22 __attribute__((amdgpu_num_sgpr(20), amdgpu_num_vgpr(40))) // expected-no-diagnostics 23 kernel void test_num_sgpr20_vgpr40() { 24 // CHECK: define amdgpu_kernel void @test_num_sgpr20_vgpr40() [[ATTR_SGPR20_VGPR40:#[0-9]+]] 25 } 26 27 __attribute__((amdgpu_num_vgpr(0))) // expected-no-diagnostics 28 kernel void test_num_vgpr0() { 29 } 30 31 __attribute__((amdgpu_num_sgpr(0))) // expected-no-diagnostics 32 kernel void test_num_sgpr0() { 33 } 34 35 __attribute__((amdgpu_num_vgpr(0), amdgpu_num_sgpr(0))) // expected-no-diagnostics 36 kernel void test_num_vgpr0_sgpr0() { 37 } 38 39 40 // X86-NOT: "amdgpu_num_vgpr" 41 // X86-NOT: "amdgpu_num_sgpr" 42 43 // CHECK-NOT: "amdgpu_num_vgpr"="0" 44 // CHECK-NOT: "amdgpu_num_sgpr"="0" 45 // CHECK-DAG: attributes [[ATTR_VGPR64]] = { nounwind "amdgpu_num_vgpr"="64" 46 // CHECK-DAG: attributes [[ATTR_SGPR32]] = { nounwind "amdgpu_num_sgpr"="32" 47 // CHECK-DAG: attributes [[ATTR_VGPR64_SGPR32]] = { nounwind "amdgpu_num_sgpr"="32" "amdgpu_num_vgpr"="64" 48 // CHECK-DAG: attributes [[ATTR_SGPR20_VGPR40]] = { nounwind "amdgpu_num_sgpr"="20" "amdgpu_num_vgpr"="40" 49