diff options
author | Eric Fiselier <eric@efcs.ca> | 2016-12-24 03:27:52 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2016-12-24 03:27:52 +0000 |
commit | db0931880ac29f913ea9f26448c7405a63aa892c (patch) | |
tree | 5c865dc50ec103a6c3bd861c2e9b8afe30fb0f68 /libcxx/test | |
parent | e161f97b81fb93331e0af426d22c12ec5d0cf8bc (diff) | |
download | bcm5719-llvm-db0931880ac29f913ea9f26448c7405a63aa892c.tar.gz bcm5719-llvm-db0931880ac29f913ea9f26448c7405a63aa892c.zip |
Fix ASAN test failure
llvm-svn: 290482
Diffstat (limited to 'libcxx/test')
-rw-r--r-- | libcxx/test/libcxx/containers/sequences/vector/asan.pass.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libcxx/test/libcxx/containers/sequences/vector/asan.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/asan.pass.cpp index d3604f0c3a5..db337e6b236 100644 --- a/libcxx/test/libcxx/containers/sequences/vector/asan.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/asan.pass.cpp @@ -38,7 +38,8 @@ int main() const T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; C c(std::begin(t), std::end(t)); c.reserve(2*c.size()); - T foo = c[c.size()]; // bad, but not caught by ASAN + volatile T foo = c[c.size()]; // bad, but not caught by ASAN + ((void)foo); } #endif @@ -64,6 +65,7 @@ int main() assert(!__sanitizer_verify_contiguous_container( c.data(), c.data() + 1, c.data() + c.capacity())); volatile T foo = c[c.size()]; // should trigger ASAN. Use volatile to prevent being optimized away. assert(false); // if we got here, ASAN didn't trigger + ((void)foo); } } #else |