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