diff --git a/clang/lib/Basic/Targets/SPIR.h b/clang/lib/Basic/Targets/SPIR.h index c17b08bea819d..f80b8b3fc84c8 100644 --- a/clang/lib/Basic/Targets/SPIR.h +++ b/clang/lib/Basic/Targets/SPIR.h @@ -331,8 +331,9 @@ class LLVM_LIBRARY_VISIBILITY WindowsX86_32SPIRTargetInfo if (CC == CC_X86VectorCall) // Permit CC_X86VectorCall which is used in Microsoft headers return CCCR_OK; - return (CC == CC_SpirFunction || CC == CC_DeviceKernel) ? CCCR_OK - : CCCR_Warning; + return (CC == CC_C || CC == CC_SpirFunction || CC == CC_DeviceKernel) + ? CCCR_OK + : CCCR_Warning; } }; @@ -383,8 +384,9 @@ class LLVM_LIBRARY_VISIBILITY WindowsX86_64_SPIR64TargetInfo // Permit CC_X86RegCall which is used to mark external functions with // explicit simd or structure type arguments to pass them via registers. return CCCR_OK; - return (CC == CC_SpirFunction || CC == CC_DeviceKernel) ? CCCR_OK - : CCCR_Warning; + return (CC == CC_C || CC == CC_SpirFunction || CC == CC_DeviceKernel) + ? CCCR_OK + : CCCR_Warning; } bool @@ -432,8 +434,9 @@ class LLVM_LIBRARY_VISIBILITY WindowsARM64_SPIR64TargetInfo } CallingConvCheckResult checkCallingConvention(CallingConv CC) const override { - return (CC == CC_SpirFunction || CC == CC_DeviceKernel) ? CCCR_OK - : CCCR_Warning; + return (CC == CC_C || CC == CC_SpirFunction || CC == CC_DeviceKernel) + ? CCCR_OK + : CCCR_Warning; } }; @@ -616,8 +619,9 @@ class LLVM_LIBRARY_VISIBILITY WindowsX86_32SPIRV32TargetInfo if (CC == CC_X86VectorCall) // Permit CC_X86VectorCall which is used in Microsoft headers return CCCR_OK; - return (CC == CC_SpirFunction || CC == CC_DeviceKernel) ? CCCR_OK - : CCCR_Warning; + return (CC == CC_C || CC == CC_SpirFunction || CC == CC_DeviceKernel) + ? CCCR_OK + : CCCR_Warning; } }; @@ -666,8 +670,9 @@ class LLVM_LIBRARY_VISIBILITY WindowsX86_64_SPIRV64TargetInfo // Permit CC_X86RegCall which is used to mark external functions with // explicit simd or structure type arguments to pass them via registers. return CCCR_OK; - return (CC == CC_SpirFunction || CC == CC_DeviceKernel) ? CCCR_OK - : CCCR_Warning; + return (CC == CC_C || CC == CC_SpirFunction || CC == CC_DeviceKernel) + ? CCCR_OK + : CCCR_Warning; } }; diff --git a/clang/test/SemaHIP/amdgcnspirv-host-cconv-in-abstract-type.hip b/clang/test/SemaHIP/amdgcnspirv-host-cconv-in-abstract-type.hip index f6b4ed3d6c33e..95c1154a68f5f 100644 --- a/clang/test/SemaHIP/amdgcnspirv-host-cconv-in-abstract-type.hip +++ b/clang/test/SemaHIP/amdgcnspirv-host-cconv-in-abstract-type.hip @@ -1,4 +1,3 @@ -// RUN: %clang_cc1 %s -fcuda-is-device -std=c++17 -triple spirv32 -aux-triple x86_64-pc-windows-msvc -fms-extensions -verify // RUN: %clang_cc1 %s -fcuda-is-device -std=c++17 -triple spirv64 -aux-triple x86_64-pc-windows-msvc -fms-extensions -verify // RUN: %clang_cc1 %s -fcuda-is-device -std=c++17 -triple spirv64-amd-amdhsa -aux-triple x86_64-pc-windows-msvc -fms-extensions -verify