diff options
| author | Tim Northover <t.p.northover@gmail.com> | 2019-11-21 10:31:30 +0000 |
|---|---|---|
| committer | Tim Northover <t.p.northover@gmail.com> | 2019-11-21 10:37:56 +0000 |
| commit | 5cf58768cb3ba31ee37facaf23f7a74f78781590 (patch) | |
| tree | 7b811554233ff808a360120b3404987354c4e54b /clang/test/SemaOpenCL | |
| parent | 9f3fdb0d7fab73083e354768eb5808597474e1b8 (diff) | |
| download | bcm5719-llvm-5cf58768cb3ba31ee37facaf23f7a74f78781590.tar.gz bcm5719-llvm-5cf58768cb3ba31ee37facaf23f7a74f78781590.zip | |
Atomics: support min/max orthogonally
We seem to have been gradually growing support for atomic min/max operations
(exposing longstanding IR atomicrmw instructions). But until now there have
been gaps in the expected intrinsics. This adds support for the C11-style
intrinsics (i.e. taking _Atomic, rather than individually blessed by C11
standard), and the variants that return the new value instead of the original
one.
That way, people won't be misled by trying one form and it not working, and the
front-end is more friendly to people using _Atomic types, as we recommend.
Diffstat (limited to 'clang/test/SemaOpenCL')
| -rw-r--r-- | clang/test/SemaOpenCL/atomic-ops.cl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/SemaOpenCL/atomic-ops.cl b/clang/test/SemaOpenCL/atomic-ops.cl index 540520d4e32..d8021e33af6 100644 --- a/clang/test/SemaOpenCL/atomic-ops.cl +++ b/clang/test/SemaOpenCL/atomic-ops.cl @@ -73,7 +73,7 @@ void f(atomic_int *i, const atomic_int *ci, __opencl_atomic_fetch_add(d, 1, memory_order_seq_cst, memory_scope_work_group); // expected-error {{address argument to atomic operation must be a pointer to atomic integer or pointer ('__generic atomic_float *' (aka '__generic _Atomic(float) *') invalid)}} __opencl_atomic_fetch_and(i, 1, memory_order_seq_cst, memory_scope_work_group); __opencl_atomic_fetch_and(p, 1, memory_order_seq_cst, memory_scope_work_group); - __opencl_atomic_fetch_and(d, 1, memory_order_seq_cst, memory_scope_work_group); // expected-error {{address argument to bitwise atomic operation must be a pointer to atomic integer ('__generic atomic_float *' (aka '__generic _Atomic(float) *') invalid)}} + __opencl_atomic_fetch_and(d, 1, memory_order_seq_cst, memory_scope_work_group); // expected-error {{address argument to atomic operation must be a pointer to atomic integer ('__generic atomic_float *' (aka '__generic _Atomic(float) *') invalid)}} __opencl_atomic_fetch_min(i, 1, memory_order_seq_cst, memory_scope_work_group); __opencl_atomic_fetch_max(i, 1, memory_order_seq_cst, memory_scope_work_group); |

