diff options
Diffstat (limited to 'clang/test/SemaCUDA/function-overload.cu')
-rw-r--r-- | clang/test/SemaCUDA/function-overload.cu | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/SemaCUDA/function-overload.cu b/clang/test/SemaCUDA/function-overload.cu index 4545a808759..161a54ef35f 100644 --- a/clang/test/SemaCUDA/function-overload.cu +++ b/clang/test/SemaCUDA/function-overload.cu @@ -193,12 +193,22 @@ __host__ __device__ void hostdevicef() { CurrentFnPtr fp_cdh = cdh; CurrentReturnTy ret_cdh = cdh(); + GlobalFnPtr fp_g = g; +#if defined(__CUDA_ARCH__) + // expected-error@-2 {{reference to __global__ function 'g' in __host__ __device__ function}} +#endif + g(); #if defined (__CUDA_ARCH__) // expected-error@-2 {{reference to __global__ function 'g' in __host__ __device__ function}} #else // expected-error@-4 {{call to global function g not configured}} #endif + + g<<<0,0>>>(); +#if defined(__CUDA_ARCH__) + // expected-error@-2 {{reference to __global__ function 'g' in __host__ __device__ function}} +#endif } // Test for address of overloaded function resolution in the global context. |