| // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py |
| // REQUIRES: amdgpu-registered-target |
| // RUN: %clang_cc1 -verify -cl-std=CL2.0 -triple amdgcn-unknown-unknown -target-cpu gfx1250 -emit-llvm -o - %s |
| // RUN: %clang_cc1 -verify -cl-std=CL2.0 -triple amdgcn-unknown-unknown -target-cpu gfx1251 -emit-llvm -o - %s |
| |
| typedef int v2i __attribute__((ext_vector_type(2))); |
| typedef int v4i __attribute__((ext_vector_type(4))); |
| |
| void test_amdgcn_cooperative_atomic_store_32x4B(global int* gaddr, int val, const char* syncscope) |
| { |
| __builtin_amdgcn_cooperative_atomic_store_32x4B(gaddr, val, __ATOMIC_RELAXED, syncscope); // expected-error {{expression is not a string literal}} |
| } |
| |
| int test_amdgcn_cooperative_atomic_load_32x4B(global int* gaddr, const char* syncscope) |
| { |
| return __builtin_amdgcn_cooperative_atomic_load_32x4B(gaddr, __ATOMIC_RELAXED, syncscope); // expected-error {{expression is not a string literal}} |
| } |
| |
| void test_amdgcn_cooperative_atomic_store_16x8B(global v2i* gaddr, v2i val, const char* syncscope) |
| { |
| __builtin_amdgcn_cooperative_atomic_store_16x8B(gaddr, val, __ATOMIC_RELAXED, syncscope); // expected-error {{expression is not a string literal}} |
| } |
| |
| v2i test_amdgcn_cooperative_atomic_load_16x8B(global v2i* gaddr, const char* syncscope) |
| { |
| return __builtin_amdgcn_cooperative_atomic_load_16x8B(gaddr, __ATOMIC_RELAXED, syncscope); // expected-error {{expression is not a string literal}} |
| } |
| |
| void test_amdgcn_cooperative_atomic_store_8x16B(global v4i* gaddr, v4i val, const char* syncscope) |
| { |
| __builtin_amdgcn_cooperative_atomic_store_8x16B(gaddr, val, __ATOMIC_RELAXED, syncscope); // expected-error {{expression is not a string literal}} |
| } |
| |
| v4i test_amdgcn_cooperative_atomic_load_8x16B(global v4i* gaddr, const char* syncscope) |
| { |
| return __builtin_amdgcn_cooperative_atomic_load_8x16B(gaddr, __ATOMIC_RELAXED, syncscope); // expected-error {{expression is not a string literal}} |
| } |
| |
| v4i test_amdgcn_cooperative_atomic_load_8x16B_release(global v4i* gaddr) |
| { |
| return __builtin_amdgcn_cooperative_atomic_load_8x16B(gaddr, __ATOMIC_RELEASE, ""); // expected-warning {{memory order argument to atomic operation is invalid}} |
| } |
| |
| v4i test_amdgcn_cooperative_atomic_load_8x16B_acq_rel(global v4i* gaddr) |
| { |
| return __builtin_amdgcn_cooperative_atomic_load_8x16B(gaddr, __ATOMIC_ACQ_REL, ""); // expected-warning {{memory order argument to atomic operation is invalid}} |
| } |
| |
| void test_amdgcn_cooperative_atomic_store_32x4B__sharedptr(local int* addr, int val) |
| { |
| __builtin_amdgcn_cooperative_atomic_store_32x4B(addr, val, __ATOMIC_RELAXED, ""); // expected-error {{cooperative atomic requires a global or generic pointer}} |
| } |
| |
| void test_amdgcn_cooperative_atomic_store_32x4B__ordering_not_imm(local int* addr, int ord, int val) |
| { |
| __builtin_amdgcn_cooperative_atomic_store_32x4B(addr, val, ord, ""); // expected-error {{argument to '__builtin_amdgcn_cooperative_atomic_store_32x4B' must be a constant integer}} |
| } |
| |
| void test_amdgcn_cooperative_atomic_store_32x4B__acquire(int* addr, int ord, int val) |
| { |
| __builtin_amdgcn_cooperative_atomic_store_32x4B(addr, val, __ATOMIC_ACQUIRE, ""); // expected-warning {{memory order argument to atomic operation is invalid}} |
| } |
| |
| void test_amdgcn_cooperative_atomic_store_32x4B__acq_rel(int* addr, int ord, int val) |
| { |
| __builtin_amdgcn_cooperative_atomic_store_32x4B(addr, val, __ATOMIC_ACQ_REL, ""); // expected-warning {{memory order argument to atomic operation is invalid}} |
| } |