diff options
author | Eric Fiselier <eric@efcs.ca> | 2014-12-20 01:40:03 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2014-12-20 01:40:03 +0000 |
commit | 5a83710e371fe68a06e6e3876c6a2c8b820a8976 (patch) | |
tree | afde4c82ad6704681781c5cd49baa3fbd05c85db /libcxx/test/std/input.output/iostreams.base/ios.base/ios.base.storage | |
parent | f11e8eab527fba316c64112f6e05de1a79693a3e (diff) | |
download | bcm5719-llvm-5a83710e371fe68a06e6e3876c6a2c8b820a8976.tar.gz bcm5719-llvm-5a83710e371fe68a06e6e3876c6a2c8b820a8976.zip |
Move test into test/std subdirectory.
llvm-svn: 224658
Diffstat (limited to 'libcxx/test/std/input.output/iostreams.base/ios.base/ios.base.storage')
3 files changed, 111 insertions, 0 deletions
diff --git a/libcxx/test/std/input.output/iostreams.base/ios.base/ios.base.storage/iword.pass.cpp b/libcxx/test/std/input.output/iostreams.base/ios.base/ios.base.storage/iword.pass.cpp new file mode 100644 index 00000000000..1e2ee50632a --- /dev/null +++ b/libcxx/test/std/input.output/iostreams.base/ios.base/ios.base.storage/iword.pass.cpp @@ -0,0 +1,42 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <ios> + +// class ios_base + +// long& iword(int idx); + +#include <ios> +#include <string> +#include <cassert> + +class test + : public std::ios +{ +public: + test() + { + init(0); + } +}; + +int main() +{ + test t; + std::ios_base& b = t; + for (int i = 0; i < 10000; ++i) + { + assert(b.iword(i) == 0); + b.iword(i) = i; + assert(b.iword(i) == i); + for (int j = 0; j <= i; ++j) + assert(b.iword(j) == j); + } +} diff --git a/libcxx/test/std/input.output/iostreams.base/ios.base/ios.base.storage/pword.pass.cpp b/libcxx/test/std/input.output/iostreams.base/ios.base/ios.base.storage/pword.pass.cpp new file mode 100644 index 00000000000..5246ad8f644 --- /dev/null +++ b/libcxx/test/std/input.output/iostreams.base/ios.base/ios.base.storage/pword.pass.cpp @@ -0,0 +1,43 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <ios> + +// class ios_base + +// void*& pword(int idx); + +#include <ios> +#include <string> +#include <cassert> +#include <cstdint> + +class test + : public std::ios +{ +public: + test() + { + init(0); + } +}; + +int main() +{ + test t; + std::ios_base& b = t; + for (std::intptr_t i = 0; i < 10000; ++i) + { + assert(b.pword(i) == 0); + b.pword(i) = (void*)i; + assert(b.pword(i) == (void*)i); + for (std::intptr_t j = 0; j <= i; ++j) + assert(b.pword(j) == (void*)j); + } +} diff --git a/libcxx/test/std/input.output/iostreams.base/ios.base/ios.base.storage/xalloc.pass.cpp b/libcxx/test/std/input.output/iostreams.base/ios.base/ios.base.storage/xalloc.pass.cpp new file mode 100644 index 00000000000..eb737b1a7dc --- /dev/null +++ b/libcxx/test/std/input.output/iostreams.base/ios.base/ios.base.storage/xalloc.pass.cpp @@ -0,0 +1,26 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <ios> + +// class ios_base + +// static int xalloc(); + +#include <ios> +#include <cassert> + +int main() +{ + assert(std::ios_base::xalloc() == 0); + assert(std::ios_base::xalloc() == 1); + assert(std::ios_base::xalloc() == 2); + assert(std::ios_base::xalloc() == 3); + assert(std::ios_base::xalloc() == 4); +} |