STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.
[libcxx] [test] Replace non-Standard "atomic_flag f(false);" with Standard
"atomic_flag f = ATOMIC_FLAG_INIT;".
The test init03.pass.cpp is explicitly testing this non-Standard extension; I'm
not changing it here, but it should be moved to the libcxx subdirectory.
http://reviews.llvm.org/D19758
Files:
test/std/atomics/atomics.flag/atomic_flag_clear.pass.cpp
test/std/atomics/atomics.flag/atomic_flag_clear_explicit.pass.cpp
test/std/atomics/atomics.flag/clear.pass.cpp
Index: test/std/atomics/atomics.flag/clear.pass.cpp
===================================================================
--- test/std/atomics/atomics.flag/clear.pass.cpp
+++ test/std/atomics/atomics.flag/clear.pass.cpp
@@ -22,49 +22,49 @@
int main()
{
{
- std::atomic_flag f(false);
+ std::atomic_flag f = ATOMIC_FLAG_INIT;
f.test_and_set();
f.clear();
assert(f.test_and_set() == 0);
}
{
- std::atomic_flag f(false);
+ std::atomic_flag f = ATOMIC_FLAG_INIT;
f.test_and_set();
f.clear(std::memory_order_relaxed);
assert(f.test_and_set() == 0);
}
{
- std::atomic_flag f(false);
+ std::atomic_flag f = ATOMIC_FLAG_INIT;
f.test_and_set();
f.clear(std::memory_order_release);
assert(f.test_and_set() == 0);
}
{
- std::atomic_flag f(false);
+ std::atomic_flag f = ATOMIC_FLAG_INIT;
f.test_and_set();
f.clear(std::memory_order_seq_cst);
assert(f.test_and_set() == 0);
}
{
- volatile std::atomic_flag f(false);
+ volatile std::atomic_flag f = ATOMIC_FLAG_INIT;
f.test_and_set();
f.clear();
assert(f.test_and_set() == 0);
}
{
- volatile std::atomic_flag f(false);
+ volatile std::atomic_flag f = ATOMIC_FLAG_INIT;
f.test_and_set();
f.clear(std::memory_order_relaxed);
assert(f.test_and_set() == 0);
}
{
- volatile std::atomic_flag f(false);
+ volatile std::atomic_flag f = ATOMIC_FLAG_INIT;
f.test_and_set();
f.clear(std::memory_order_release);
assert(f.test_and_set() == 0);
}
{
- volatile std::atomic_flag f(false);
+ volatile std::atomic_flag f = ATOMIC_FLAG_INIT;
f.test_and_set();
f.clear(std::memory_order_seq_cst);
assert(f.test_and_set() == 0);
Index: test/std/atomics/atomics.flag/atomic_flag_clear_explicit.pass.cpp
===================================================================
--- test/std/atomics/atomics.flag/atomic_flag_clear_explicit.pass.cpp
+++ test/std/atomics/atomics.flag/atomic_flag_clear_explicit.pass.cpp
@@ -22,37 +22,37 @@
int main()
{
{
- std::atomic_flag f(false);
+ std::atomic_flag f = ATOMIC_FLAG_INIT;
f.test_and_set();
atomic_flag_clear_explicit(&f, std::memory_order_relaxed);
assert(f.test_and_set() == 0);
}
{
- std::atomic_flag f(false);
+ std::atomic_flag f = ATOMIC_FLAG_INIT;
f.test_and_set();
atomic_flag_clear_explicit(&f, std::memory_order_release);
assert(f.test_and_set() == 0);
}
{
- std::atomic_flag f(false);
+ std::atomic_flag f = ATOMIC_FLAG_INIT;
f.test_and_set();
atomic_flag_clear_explicit(&f, std::memory_order_seq_cst);
assert(f.test_and_set() == 0);
}
{
- volatile std::atomic_flag f(false);
+ volatile std::atomic_flag f = ATOMIC_FLAG_INIT;
f.test_and_set();
atomic_flag_clear_explicit(&f, std::memory_order_relaxed);
assert(f.test_and_set() == 0);
}
{
- volatile std::atomic_flag f(false);
+ volatile std::atomic_flag f = ATOMIC_FLAG_INIT;
f.test_and_set();
atomic_flag_clear_explicit(&f, std::memory_order_release);
assert(f.test_and_set() == 0);
}
{
- volatile std::atomic_flag f(false);
+ volatile std::atomic_flag f = ATOMIC_FLAG_INIT;
f.test_and_set();
atomic_flag_clear_explicit(&f, std::memory_order_seq_cst);
assert(f.test_and_set() == 0);
Index: test/std/atomics/atomics.flag/atomic_flag_clear.pass.cpp
===================================================================
--- test/std/atomics/atomics.flag/atomic_flag_clear.pass.cpp
+++ test/std/atomics/atomics.flag/atomic_flag_clear.pass.cpp
@@ -22,13 +22,13 @@
int main()
{
{
- std::atomic_flag f(false);
+ std::atomic_flag f = ATOMIC_FLAG_INIT;
f.test_and_set();
atomic_flag_clear(&f);
assert(f.test_and_set() == 0);
}
{
- volatile std::atomic_flag f(false);
+ volatile std::atomic_flag f = ATOMIC_FLAG_INIT;
f.test_and_set();
atomic_flag_clear(&f);
assert(f.test_and_set() == 0);
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits