| 1 |
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py |
| 2 |
// REQUIRES: amdgpu-registered-target |
| 3 |
// RUN: %clang_cc1 -verify -cl-std=CL2.0 -triple amdgcn-unknown-unknown -target-cpu gfx1250 -emit-llvm -o - %s |
| 4 |
// RUN: %clang_cc1 -verify -cl-std=CL2.0 -triple amdgcn-unknown-unknown -target-cpu gfx1251 -emit-llvm -o - %s |
| 5 |
|
| 6 |
typedef int v2i __attribute__((ext_vector_type(2))); |
| 7 |
typedef int v4i __attribute__((ext_vector_type(4))); |
| 8 |
|
| 9 |
void test_amdgcn_cooperative_atomic_store_32x4B(global int* gaddr, int val, const char* syncscope) |
| 10 |
{ |
| 11 |
__builtin_amdgcn_cooperative_atomic_store_32x4B(gaddr, val, __ATOMIC_RELAXED, syncscope); // expected-error {{expression is not a string literal}} |
| 12 |
} |
| 13 |
|
| 14 |
int test_amdgcn_cooperative_atomic_load_32x4B(global int* gaddr, const char* syncscope) |
| 15 |
{ |
| 16 |
return __builtin_amdgcn_cooperative_atomic_load_32x4B(gaddr, __ATOMIC_RELAXED, syncscope); // expected-error {{expression is not a string literal}} |
| 17 |
} |
| 18 |
|
| 19 |
void test_amdgcn_cooperative_atomic_store_16x8B(global v2i* gaddr, v2i val, const char* syncscope) |
| 20 |
{ |
| 21 |
__builtin_amdgcn_cooperative_atomic_store_16x8B(gaddr, val, __ATOMIC_RELAXED, syncscope); // expected-error {{expression is not a string literal}} |
| 22 |
} |
| 23 |
|
| 24 |
v2i test_amdgcn_cooperative_atomic_load_16x8B(global v2i* gaddr, const char* syncscope) |
| 25 |
{ |
| 26 |
return __builtin_amdgcn_cooperative_atomic_load_16x8B(gaddr, __ATOMIC_RELAXED, syncscope); // expected-error {{expression is not a string literal}} |
| 27 |
} |
| 28 |
|
| 29 |
void test_amdgcn_cooperative_atomic_store_8x16B(global v4i* gaddr, v4i val, const char* syncscope) |
| 30 |
{ |
| 31 |
__builtin_amdgcn_cooperative_atomic_store_8x16B(gaddr, val, __ATOMIC_RELAXED, syncscope); // expected-error {{expression is not a string literal}} |
| 32 |
} |
| 33 |
|
| 34 |
v4i test_amdgcn_cooperative_atomic_load_8x16B(global v4i* gaddr, const char* syncscope) |
| 35 |
{ |
| 36 |
return __builtin_amdgcn_cooperative_atomic_load_8x16B(gaddr, __ATOMIC_RELAXED, syncscope); // expected-error {{expression is not a string literal}} |
| 37 |
} |
| 38 |
|
| 39 |
v4i test_amdgcn_cooperative_atomic_load_8x16B_release(global v4i* gaddr) |
| 40 |
{ |
| 41 |
return __builtin_amdgcn_cooperative_atomic_load_8x16B(gaddr, __ATOMIC_RELEASE, ""); // expected-warning {{memory order argument to atomic operation is invalid}} |
| 42 |
} |
| 43 |
|
| 44 |
v4i test_amdgcn_cooperative_atomic_load_8x16B_acq_rel(global v4i* gaddr) |
| 45 |
{ |
| 46 |
return __builtin_amdgcn_cooperative_atomic_load_8x16B(gaddr, __ATOMIC_ACQ_REL, ""); // expected-warning {{memory order argument to atomic operation is invalid}} |
| 47 |
} |
| 48 |
|
| 49 |
void test_amdgcn_cooperative_atomic_store_32x4B__sharedptr(local int* addr, int val) |
| 50 |
{ |
| 51 |
__builtin_amdgcn_cooperative_atomic_store_32x4B(addr, val, __ATOMIC_RELAXED, ""); // expected-error {{cooperative atomic requires a global or generic pointer}} |
| 52 |
} |
| 53 |
|
| 54 |
void test_amdgcn_cooperative_atomic_store_32x4B__ordering_not_imm(local int* addr, int ord, int val) |
| 55 |
{ |
| 56 |
__builtin_amdgcn_cooperative_atomic_store_32x4B(addr, val, ord, ""); // expected-error {{argument to '__builtin_amdgcn_cooperative_atomic_store_32x4B' must be a constant integer}} |
| 57 |
} |
| 58 |
|
| 59 |
void test_amdgcn_cooperative_atomic_store_32x4B__acquire(int* addr, int ord, int val) |
| 60 |
{ |
| 61 |
__builtin_amdgcn_cooperative_atomic_store_32x4B(addr, val, __ATOMIC_ACQUIRE, ""); // expected-warning {{memory order argument to atomic operation is invalid}} |
| 62 |
} |
| 63 |
|
| 64 |
void test_amdgcn_cooperative_atomic_store_32x4B__acq_rel(int* addr, int ord, int val) |
| 65 |
{ |
| 66 |
__builtin_amdgcn_cooperative_atomic_store_32x4B(addr, val, __ATOMIC_ACQ_REL, ""); // expected-warning {{memory order argument to atomic operation is invalid}} |
| 67 |
} |