summaryrefslogtreecommitdiffstats
path: root/libcxx/test
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2018-02-14 18:05:25 +0000
committerMarshall Clow <mclow.lists@gmail.com>2018-02-14 18:05:25 +0000
commit36c4862a379d920600f95257fe0aa13cb5fd9d87 (patch)
treede77e1a906888d977256d62931c7f47cfb5877c3 /libcxx/test
parentc078ca92ebe20fd497d9da68bc4b99fd2163f097 (diff)
downloadbcm5719-llvm-36c4862a379d920600f95257fe0aa13cb5fd9d87.tar.gz
bcm5719-llvm-36c4862a379d920600f95257fe0aa13cb5fd9d87.zip
Add a catch for std::length_error for the case where the string can't handle 2GB. (like say 32-bit big-endian)
llvm-svn: 325147
Diffstat (limited to 'libcxx/test')
-rw-r--r--libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp
index e7bdd897c74..460e4c07ec9 100644
--- a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp
+++ b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp
@@ -32,12 +32,13 @@ int main()
#ifndef TEST_HAS_NO_EXCEPTIONS
try {
#endif
- std::string str(2147483648, 'a');
- SB sb;
- sb.str(str);
- assert(sb.pubpbase() <= sb.pubpptr());
+ std::string str(2147483648, 'a');
+ SB sb;
+ sb.str(str);
+ assert(sb.pubpbase() <= sb.pubpptr());
#ifndef TEST_HAS_NO_EXCEPTIONS
- }
- catch (const std::bad_alloc &) {}
+ }
+ catch (const std::length_error &) {} // maybe the string can't take 2GB
+ catch (const std::bad_alloc &) {} // maybe we don't have enough RAM
#endif
}
OpenPOWER on IntegriCloud