diff options
author | Roger Ferrer Ibanez <roger.ferreribanez@arm.com> | 2016-11-29 17:10:29 +0000 |
---|---|---|
committer | Roger Ferrer Ibanez <roger.ferreribanez@arm.com> | 2016-11-29 17:10:29 +0000 |
commit | 86663cd0ef236f876c27adb822857ccaccf12b70 (patch) | |
tree | f9863245300ec626a73dbd04df491455be5376c5 /libcxx/test/std/containers/sequences/array/at.pass.cpp | |
parent | 2dfeb6e3c23c11eecb1af55b566faf5d42064015 (diff) | |
download | bcm5719-llvm-86663cd0ef236f876c27adb822857ccaccf12b70.tar.gz bcm5719-llvm-86663cd0ef236f876c27adb822857ccaccf12b70.zip |
Protect std::array tests under noexceptions
Skip tests that expect exceptions be thrown. Also add missing asserts.
Differential Revision: https://reviews.llvm.org/D27095
llvm-svn: 288165
Diffstat (limited to 'libcxx/test/std/containers/sequences/array/at.pass.cpp')
-rw-r--r-- | libcxx/test/std/containers/sequences/array/at.pass.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/libcxx/test/std/containers/sequences/array/at.pass.cpp b/libcxx/test/std/containers/sequences/array/at.pass.cpp index 9707beeb394..29483153d4a 100644 --- a/libcxx/test/std/containers/sequences/array/at.pass.cpp +++ b/libcxx/test/std/containers/sequences/array/at.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: libcpp-no-exceptions // <array> // reference operator[] (size_type) @@ -40,8 +39,14 @@ int main() r2 = 7.5; assert(c.back() == 7.5); - try { (void) c.at(3); } +#ifndef TEST_HAS_NO_EXCEPTIONS + try + { + (void) c.at(3); + assert(false); + } catch (const std::out_of_range &) {} +#endif } { typedef double T; @@ -53,8 +58,14 @@ int main() C::const_reference r2 = c.at(2); assert(r2 == 3.5); - try { (void) c.at(3); } +#ifndef TEST_HAS_NO_EXCEPTIONS + try + { + (void) c.at(3); + assert(false); + } catch (const std::out_of_range &) {} +#endif } #if TEST_STD_VER > 11 |