diff options
author | dim <dim@FreeBSD.org> | 2013-12-22 00:07:40 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-12-22 00:07:40 +0000 |
commit | 952eddef9aff85b1e92626e89baaf7a360e2ac85 (patch) | |
tree | df8df0b0067b381eab470a3b8f28d14a552a6340 /test/Sema/atomic-ops.c | |
parent | ea266cad53e3d49771fa38103913d3ec7a166694 (diff) | |
download | FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.zip FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.tar.gz |
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841
Diffstat (limited to 'test/Sema/atomic-ops.c')
-rw-r--r-- | test/Sema/atomic-ops.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/test/Sema/atomic-ops.c b/test/Sema/atomic-ops.c index b3daa07..c2d38e7 100644 --- a/test/Sema/atomic-ops.c +++ b/test/Sema/atomic-ops.c @@ -86,8 +86,8 @@ void f(_Atomic(int) *i, _Atomic(int*) *p, _Atomic(float) *d, __c11_atomic_init(I, 5); // expected-error {{pointer to _Atomic}} __c11_atomic_load(0); // expected-error {{too few arguments to function}} __c11_atomic_load(0,0,0); // expected-error {{too many arguments to function}} - __c11_atomic_store(0,0,0); // expected-error {{first argument to atomic builtin must be a pointer}} - __c11_atomic_store((int*)0,0,0); // expected-error {{first argument to atomic operation must be a pointer to _Atomic}} + __c11_atomic_store(0,0,0); // expected-error {{address argument to atomic builtin must be a pointer}} + __c11_atomic_store((int*)0,0,0); // expected-error {{address argument to atomic operation must be a pointer to _Atomic}} __c11_atomic_load(i, memory_order_seq_cst); __c11_atomic_load(p, memory_order_seq_cst); @@ -169,10 +169,16 @@ void f(_Atomic(int) *i, _Atomic(int*) *p, _Atomic(float) *d, (int)__atomic_clear(&flag, memory_order_seq_cst); // expected-error {{operand of type 'void'}} const _Atomic(int) const_atomic; - __c11_atomic_init(&const_atomic, 0); // expected-error {{first argument to atomic operation must be a pointer to non-const _Atomic type ('const _Atomic(int) *' invalid)}} - __c11_atomic_store(&const_atomic, 0, memory_order_release); // expected-error {{first argument to atomic operation must be a pointer to non-const _Atomic type ('const _Atomic(int) *' invalid)}} - __c11_atomic_load(&const_atomic, memory_order_acquire); // expected-error {{first argument to atomic operation must be a pointer to non-const _Atomic type ('const _Atomic(int) *' invalid)}} + __c11_atomic_init(&const_atomic, 0); // expected-error {{address argument to atomic operation must be a pointer to non-const _Atomic type ('const _Atomic(int) *' invalid)}} + __c11_atomic_store(&const_atomic, 0, memory_order_release); // expected-error {{address argument to atomic operation must be a pointer to non-const _Atomic type ('const _Atomic(int) *' invalid)}} + __c11_atomic_load(&const_atomic, memory_order_acquire); // expected-error {{address argument to atomic operation must be a pointer to non-const _Atomic type ('const _Atomic(int) *' invalid)}} } _Atomic(int*) PR12527_a; void PR12527() { int *b = PR12527_a; } + +void PR16931(int* x) { // expected-note {{passing argument to parameter 'x' here}} + typedef struct { _Atomic(_Bool) flag; } flag; + flag flagvar = { 0 }; + PR16931(&flagvar); // expected-warning {{incompatible pointer types}} +} |