summaryrefslogtreecommitdiffstats
path: root/libcxx/test
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-07-23 01:43:53 +0000
committerEric Fiselier <eric@efcs.ca>2016-07-23 01:43:53 +0000
commit6f4a165e5147293020e4c3e922f4b088d9de2f5f (patch)
treeb07580b15999f9534793c29636d0934ca76bd3be /libcxx/test
parent586b16e16a51c2a361de35e1a467723f6a25acc7 (diff)
downloadbcm5719-llvm-6f4a165e5147293020e4c3e922f4b088d9de2f5f.tar.gz
bcm5719-llvm-6f4a165e5147293020e4c3e922f4b088d9de2f5f.zip
Revert r276506 - Diagnose invalid memory order arguments in <atomic>.
There is a bug in Clang 3.6 and earlier that causes compile failures. I suspect it's due to the usage of member function parameter names in the attributes. llvm-svn: 276507
Diffstat (limited to 'libcxx/test')
-rw-r--r--libcxx/test/libcxx/atomics/diagnose_invalid_memory_order.fail.cpp125
1 files changed, 0 insertions, 125 deletions
diff --git a/libcxx/test/libcxx/atomics/diagnose_invalid_memory_order.fail.cpp b/libcxx/test/libcxx/atomics/diagnose_invalid_memory_order.fail.cpp
deleted file mode 100644
index 58fc684e049..00000000000
--- a/libcxx/test/libcxx/atomics/diagnose_invalid_memory_order.fail.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// The attributes used to diagnose incorrect memory order inputs is clang
-// specific.
-// UNSUPPORTED: gcc
-
-// <atomic>
-
-// Test that invalid memory order arguments are diagnosed where possible.
-
-#include <atomic>
-
-int main() {
- std::atomic<int> x(42);
- volatile std::atomic<int>& vx = x;
- int val1 = 1;
- int val2 = 2;
- // load operations
- {
- x.load(std::memory_order_release); // expected-error {{operation is invalid}}
- x.load(std::memory_order_acq_rel); // expected-error {{operation is invalid}}
- vx.load(std::memory_order_release); // expected-error {{operation is invalid}}
- vx.load(std::memory_order_acq_rel); // expected-error {{operation is invalid}}
- // valid memory orders
- x.load(std::memory_order_relaxed);
- x.load(std::memory_order_consume);
- x.load(std::memory_order_acquire);
- x.load(std::memory_order_seq_cst);
- }
- {
- std::atomic_load_explicit(&x, std::memory_order_release); // expected-error {{operation is invalid}}
- std::atomic_load_explicit(&x, std::memory_order_acq_rel); // expected-error {{operation is invalid}}
- std::atomic_load_explicit(&vx, std::memory_order_release); // expected-error {{operation is invalid}}
- std::atomic_load_explicit(&vx, std::memory_order_acq_rel); // expected-error {{operation is invalid}}
- // valid memory orders
- std::atomic_load_explicit(&x, std::memory_order_relaxed);
- std::atomic_load_explicit(&x, std::memory_order_consume);
- std::atomic_load_explicit(&x, std::memory_order_acquire);
- std::atomic_load_explicit(&x, std::memory_order_seq_cst);
- }
- // store operations
- {
- x.store(42, std::memory_order_consume); // expected-error {{operation is invalid}}
- x.store(42, std::memory_order_acquire); // expected-error {{operation is invalid}}
- x.store(42, std::memory_order_acq_rel); // expected-error {{operation is invalid}}
- vx.store(42, std::memory_order_consume); // expected-error {{operation is invalid}}
- vx.store(42, std::memory_order_acquire); // expected-error {{operation is invalid}}
- vx.store(42, std::memory_order_acq_rel); // expected-error {{operation is invalid}}
- // valid memory orders
- x.store(42, std::memory_order_relaxed);
- x.store(42, std::memory_order_release);
- x.store(42, std::memory_order_seq_cst);
- }
- {
- std::atomic_store_explicit(&x, 42, std::memory_order_consume); // expected-error {{operation is invalid}}
- std::atomic_store_explicit(&x, 42, std::memory_order_acquire); // expected-error {{operation is invalid}}
- std::atomic_store_explicit(&x, 42, std::memory_order_acq_rel); // expected-error {{operation is invalid}}
- std::atomic_store_explicit(&vx, 42, std::memory_order_consume); // expected-error {{operation is invalid}}
- std::atomic_store_explicit(&vx, 42, std::memory_order_acquire); // expected-error {{operation is invalid}}
- std::atomic_store_explicit(&vx, 42, std::memory_order_acq_rel); // expected-error {{operation is invalid}}
- // valid memory orders
- std::atomic_store_explicit(&x, 42, std::memory_order_relaxed);
- std::atomic_store_explicit(&x, 42, std::memory_order_release);
- std::atomic_store_explicit(&x, 42, std::memory_order_seq_cst);
- }
- // compare exchange weak
- {
- x.compare_exchange_weak(val1, val2, std::memory_order_seq_cst, std::memory_order_release); // expected-error {{operation is invalid}}
- x.compare_exchange_weak(val1, val2, std::memory_order_seq_cst, std::memory_order_acq_rel); // expected-error {{operation is invalid}}
- vx.compare_exchange_weak(val1, val2, std::memory_order_seq_cst, std::memory_order_release); // expected-error {{operation is invalid}}
- vx.compare_exchange_weak(val1, val2, std::memory_order_seq_cst, std::memory_order_acq_rel); // expected-error {{operation is invalid}}
- // valid memory orders
- x.compare_exchange_weak(val1, val2, std::memory_order_seq_cst, std::memory_order_relaxed);
- x.compare_exchange_weak(val1, val2, std::memory_order_seq_cst, std::memory_order_consume);
- x.compare_exchange_weak(val1, val2, std::memory_order_seq_cst, std::memory_order_acquire);
- x.compare_exchange_weak(val1, val2, std::memory_order_seq_cst, std::memory_order_seq_cst);
- // Test that the cmpxchg overload with only one memory order argument
- // does not generate any diagnostics.
- x.compare_exchange_weak(val1, val2, std::memory_order_release);
- }
- {
- std::atomic_compare_exchange_weak_explicit(&x, &val1, val2, std::memory_order_seq_cst, std::memory_order_release); // expected-error {{operation is invalid}}
- std::atomic_compare_exchange_weak_explicit(&x, &val1, val2, std::memory_order_seq_cst, std::memory_order_acq_rel); // expected-error {{operation is invalid}}
- std::atomic_compare_exchange_weak_explicit(&vx, &val1, val2, std::memory_order_seq_cst, std::memory_order_release); // expected-error {{operation is invalid}}
- std::atomic_compare_exchange_weak_explicit(&vx, &val1, val2, std::memory_order_seq_cst, std::memory_order_acq_rel); // expected-error {{operation is invalid}}
- // valid memory orders
- std::atomic_compare_exchange_weak_explicit(&x, &val1, val2, std::memory_order_seq_cst, std::memory_order_relaxed);
- std::atomic_compare_exchange_weak_explicit(&x, &val1, val2, std::memory_order_seq_cst, std::memory_order_consume);
- std::atomic_compare_exchange_weak_explicit(&x, &val1, val2, std::memory_order_seq_cst, std::memory_order_acquire);
- std::atomic_compare_exchange_weak_explicit(&x, &val1, val2, std::memory_order_seq_cst, std::memory_order_seq_cst);
- }
- // compare exchange strong
- {
- x.compare_exchange_strong(val1, val2, std::memory_order_seq_cst, std::memory_order_release); // expected-error {{operation is invalid}}
- x.compare_exchange_strong(val1, val2, std::memory_order_seq_cst, std::memory_order_acq_rel); // expected-error {{operation is invalid}}
- vx.compare_exchange_strong(val1, val2, std::memory_order_seq_cst, std::memory_order_release); // expected-error {{operation is invalid}}
- vx.compare_exchange_strong(val1, val2, std::memory_order_seq_cst, std::memory_order_acq_rel); // expected-error {{operation is invalid}}
- // valid memory orders
- x.compare_exchange_strong(val1, val2, std::memory_order_seq_cst, std::memory_order_relaxed);
- x.compare_exchange_strong(val1, val2, std::memory_order_seq_cst, std::memory_order_consume);
- x.compare_exchange_strong(val1, val2, std::memory_order_seq_cst, std::memory_order_acquire);
- x.compare_exchange_strong(val1, val2, std::memory_order_seq_cst, std::memory_order_seq_cst);
- // Test that the cmpxchg overload with only one memory order argument
- // does not generate any diagnostics.
- x.compare_exchange_strong(val1, val2, std::memory_order_release);
- }
- {
- std::atomic_compare_exchange_strong_explicit(&x, &val1, val2, std::memory_order_seq_cst, std::memory_order_release); // expected-error {{operation is invalid}}
- std::atomic_compare_exchange_strong_explicit(&x, &val1, val2, std::memory_order_seq_cst, std::memory_order_acq_rel); // expected-error {{operation is invalid}}
- std::atomic_compare_exchange_strong_explicit(&vx, &val1, val2, std::memory_order_seq_cst, std::memory_order_release); // expected-error {{operation is invalid}}
- std::atomic_compare_exchange_strong_explicit(&vx, &val1, val2, std::memory_order_seq_cst, std::memory_order_acq_rel); // expected-error {{operation is invalid}}
- // valid memory orders
- std::atomic_compare_exchange_strong_explicit(&x, &val1, val2, std::memory_order_seq_cst, std::memory_order_relaxed);
- std::atomic_compare_exchange_strong_explicit(&x, &val1, val2, std::memory_order_seq_cst, std::memory_order_consume);
- std::atomic_compare_exchange_strong_explicit(&x, &val1, val2, std::memory_order_seq_cst, std::memory_order_acquire);
- std::atomic_compare_exchange_strong_explicit(&x, &val1, val2, std::memory_order_seq_cst, std::memory_order_seq_cst);
- }
-}
OpenPOWER on IntegriCloud