summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/atomics/atomics.flag/clear.pass.cpp
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2015-05-19 23:03:57 +0000
committerEric Fiselier <eric@efcs.ca>2015-05-19 23:03:57 +0000
commit3de417f40836c6302449ca0eaafbf05a5c863e33 (patch)
tree7c69e2400a8606d6a53b788dc53c66a63d45062e /libcxx/test/std/atomics/atomics.flag/clear.pass.cpp
parent35cb2b28ca4902f56505eb6f67886482662707fe (diff)
downloadbcm5719-llvm-3de417f40836c6302449ca0eaafbf05a5c863e33.tar.gz
bcm5719-llvm-3de417f40836c6302449ca0eaafbf05a5c863e33.zip
Fix uninitialized values and bad enum conversions found by UBSAN.
llvm-svn: 237738
Diffstat (limited to 'libcxx/test/std/atomics/atomics.flag/clear.pass.cpp')
-rw-r--r--libcxx/test/std/atomics/atomics.flag/clear.pass.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/libcxx/test/std/atomics/atomics.flag/clear.pass.cpp b/libcxx/test/std/atomics/atomics.flag/clear.pass.cpp
index 65051af790d..7c9362680bb 100644
--- a/libcxx/test/std/atomics/atomics.flag/clear.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.flag/clear.pass.cpp
@@ -22,49 +22,49 @@
int main()
{
{
- std::atomic_flag f;
+ std::atomic_flag f = ATOMIC_FLAG_INIT;
f.test_and_set();
f.clear();
assert(f.test_and_set() == 0);
}
{
- std::atomic_flag f;
+ 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;
+ 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;
+ 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;
+ 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;
+ 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;
+ 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;
+ 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);
OpenPOWER on IntegriCloud