brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 2b8fac7 Raw
26 lines · cpp
1// RUN: %clang_cc1 %s -x hip -fcuda-is-device -o - \2// RUN:   -triple=spirv64-amd-amdhsa -fsyntax-only \3// RUN:   -verify=dev4// RUN: %clang_cc1 %s -x hip -triple x86_64 -o - \5// RUN:   -aux-triple spirv64-amd-amdhsa -fsyntax-only \6// RUN:   -verify=host7 8// dev-no-diagnostics9 10void test_host() {11  __UINT32_TYPE__ val32;12  __UINT64_TYPE__ val64;13 14  // host-error@+1 {{reference to __device__ function '__builtin_amdgcn_atomic_inc32' in __host__ function}}15  val32 = __builtin_amdgcn_atomic_inc32(&val32, val32, __ATOMIC_SEQ_CST, "");16 17  // host-error@+1 {{reference to __device__ function '__builtin_amdgcn_atomic_inc64' in __host__ function}}18  val64 = __builtin_amdgcn_atomic_inc64(&val64, val64, __ATOMIC_SEQ_CST, "");19 20  // host-error@+1 {{reference to __device__ function '__builtin_amdgcn_atomic_dec32' in __host__ function}}21  val32 = __builtin_amdgcn_atomic_dec32(&val32, val32, __ATOMIC_SEQ_CST, "");22 23  // host-error@+1 {{reference to __device__ function '__builtin_amdgcn_atomic_dec64' in __host__ function}}24  val64 = __builtin_amdgcn_atomic_dec64(&val64, val64, __ATOMIC_SEQ_CST, "");25}26