diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-09-06 18:46:46 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-09-06 18:46:46 +0000 |
| commit | 61b9a7258a7693d7f3674a5a1daf7b036ff1d382 (patch) | |
| tree | ec41ed70ffca97240e76f9a78bb2dedba28f310c /test/std/input.output/iostream.objects/narrow.stream.objects | |
| parent | f857581820d15e410e9945d2fcd5f7163be25a96 (diff) | |
Notes
Diffstat (limited to 'test/std/input.output/iostream.objects/narrow.stream.objects')
4 files changed, 115 insertions, 0 deletions
diff --git a/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.pass.cpp b/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.pass.cpp new file mode 100644 index 000000000000..cdf53f86277d --- /dev/null +++ b/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.pass.cpp @@ -0,0 +1,29 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <iostream> + +// istream cerr; + +#include <iostream> +#include <cassert> + +int main() +{ +#if 0 + std::cerr << "Hello World!\n"; +#else +#ifdef _LIBCPP_HAS_NO_STDOUT + assert(std::cerr.tie() == NULL); +#else + assert(std::cerr.tie() == &std::cout); +#endif + assert(std::cerr.flags() & std::ios_base::unitbuf); +#endif // 0 +} diff --git a/test/std/input.output/iostream.objects/narrow.stream.objects/cin.pass.cpp b/test/std/input.output/iostream.objects/narrow.stream.objects/cin.pass.cpp new file mode 100644 index 000000000000..1ce04ffb1563 --- /dev/null +++ b/test/std/input.output/iostream.objects/narrow.stream.objects/cin.pass.cpp @@ -0,0 +1,34 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// XFAIL: libcpp-has-no-stdin + +// <iostream> + +// istream cin; + +#include <iostream> +#include <cassert> + +int main() +{ +#if 0 + std::cout << "Hello World!\n"; + int i; + std::cout << "Enter a number: "; + std::cin >> i; + std::cout << "The number is : " << i << '\n'; +#else // 0 +#ifdef _LIBCPP_HAS_NO_STDOUT + assert(std::cin.tie() == NULL); +#else + assert(std::cin.tie() == &std::cout); +#endif +#endif +} diff --git a/test/std/input.output/iostream.objects/narrow.stream.objects/clog.pass.cpp b/test/std/input.output/iostream.objects/narrow.stream.objects/clog.pass.cpp new file mode 100644 index 000000000000..3812b203ae04 --- /dev/null +++ b/test/std/input.output/iostream.objects/narrow.stream.objects/clog.pass.cpp @@ -0,0 +1,23 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <iostream> + +// istream clog; + +#include <iostream> + +int main() +{ +#if 0 + std::clog << "Hello World!\n"; +#else + (void)std::clog; +#endif +} diff --git a/test/std/input.output/iostream.objects/narrow.stream.objects/cout.pass.cpp b/test/std/input.output/iostream.objects/narrow.stream.objects/cout.pass.cpp new file mode 100644 index 000000000000..e5887e1625d7 --- /dev/null +++ b/test/std/input.output/iostream.objects/narrow.stream.objects/cout.pass.cpp @@ -0,0 +1,29 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// XFAIL: libcpp-has-no-stdout + +// <iostream> + +// istream cout; + +#include <iostream> + +int main() +{ +#if 0 + std::cout << "Hello World!\n"; + int i; + std::cout << "Enter a number: "; + std::cin >> i; + std::cout << "The number is : " << i << '\n'; +#else // 0 + (void)std::cout; +#endif +} |
