summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/input.output
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/std/input.output')
-rw-r--r--libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp45
-rw-r--r--libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.pass.cpp4
-rw-r--r--libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.pass.cpp6
-rw-r--r--libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.pass.cpp2
-rw-r--r--libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr.pass.cpp4
-rw-r--r--libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.pass.cpp6
-rw-r--r--libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout.pass.cpp2
7 files changed, 49 insertions, 20 deletions
diff --git a/libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp b/libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp
index 2ea09bc7bec..ec4ad8a3bbc 100644
--- a/libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/c.files/cstdio.pass.cpp
@@ -88,31 +88,17 @@ int main()
std::size_t s = 0;
char* cp = 0;
std::va_list va;
-#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
- static_assert((std::is_same<decltype(std::remove("")), int>::value), "");
- static_assert((std::is_same<decltype(std::rename("","")), int>::value), "");
- static_assert((std::is_same<decltype(std::tmpfile()), std::FILE*>::value), "");
- static_assert((std::is_same<decltype(std::tmpnam(cp)), char*>::value), "");
-#endif
static_assert((std::is_same<decltype(std::fclose(fp)), int>::value), "");
static_assert((std::is_same<decltype(std::fflush(fp)), int>::value), "");
-#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
- static_assert((std::is_same<decltype(std::fopen("", "")), std::FILE*>::value), "");
- static_assert((std::is_same<decltype(std::freopen("", "", fp)), std::FILE*>::value), "");
-#endif
static_assert((std::is_same<decltype(std::setbuf(fp,cp)), void>::value), "");
static_assert((std::is_same<decltype(std::vfprintf(fp,"",va)), int>::value), "");
static_assert((std::is_same<decltype(std::fprintf(fp," ")), int>::value), "");
static_assert((std::is_same<decltype(std::fscanf(fp,"")), int>::value), "");
- static_assert((std::is_same<decltype(std::printf(" ")), int>::value), "");
- static_assert((std::is_same<decltype(std::scanf(" ")), int>::value), "");
static_assert((std::is_same<decltype(std::snprintf(cp,0," ")), int>::value), "");
static_assert((std::is_same<decltype(std::sprintf(cp," ")), int>::value), "");
static_assert((std::is_same<decltype(std::sscanf("","")), int>::value), "");
static_assert((std::is_same<decltype(std::vfprintf(fp,"",va)), int>::value), "");
static_assert((std::is_same<decltype(std::vfscanf(fp,"",va)), int>::value), "");
- static_assert((std::is_same<decltype(std::vprintf(" ",va)), int>::value), "");
- static_assert((std::is_same<decltype(std::vscanf("",va)), int>::value), "");
static_assert((std::is_same<decltype(std::vsnprintf(cp,0," ",va)), int>::value), "");
static_assert((std::is_same<decltype(std::vsprintf(cp," ",va)), int>::value), "");
static_assert((std::is_same<decltype(std::vsscanf("","",va)), int>::value), "");
@@ -121,13 +107,7 @@ int main()
static_assert((std::is_same<decltype(std::fputc(0,fp)), int>::value), "");
static_assert((std::is_same<decltype(std::fputs("",fp)), int>::value), "");
static_assert((std::is_same<decltype(std::getc(fp)), int>::value), "");
- static_assert((std::is_same<decltype(std::getchar()), int>::value), "");
-#if _LIBCPP_STD_VER <= 11
- static_assert((std::is_same<decltype(std::gets(cp)), char*>::value), "");
-#endif
static_assert((std::is_same<decltype(std::putc(0,fp)), int>::value), "");
- static_assert((std::is_same<decltype(std::putchar(0)), int>::value), "");
- static_assert((std::is_same<decltype(std::puts("")), int>::value), "");
static_assert((std::is_same<decltype(std::ungetc(0,fp)), int>::value), "");
static_assert((std::is_same<decltype(std::fread((void*)0,0,0,fp)), std::size_t>::value), "");
static_assert((std::is_same<decltype(std::fwrite((const void*)0,0,0,fp)), std::size_t>::value), "");
@@ -140,4 +120,29 @@ int main()
static_assert((std::is_same<decltype(std::feof(fp)), int>::value), "");
static_assert((std::is_same<decltype(std::ferror(fp)), int>::value), "");
static_assert((std::is_same<decltype(std::perror("")), void>::value), "");
+
+#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
+ static_assert((std::is_same<decltype(std::fopen("", "")), std::FILE*>::value), "");
+ static_assert((std::is_same<decltype(std::freopen("", "", fp)), std::FILE*>::value), "");
+ static_assert((std::is_same<decltype(std::remove("")), int>::value), "");
+ static_assert((std::is_same<decltype(std::rename("","")), int>::value), "");
+ static_assert((std::is_same<decltype(std::tmpfile()), std::FILE*>::value), "");
+ static_assert((std::is_same<decltype(std::tmpnam(cp)), char*>::value), "");
+#endif
+
+#ifndef _LIBCPP_HAS_NO_STDIN
+ static_assert((std::is_same<decltype(std::getchar()), int>::value), "");
+#if _LIBCPP_STD_VER <= 11
+ static_assert((std::is_same<decltype(std::gets(cp)), char*>::value), "");
+#endif
+ static_assert((std::is_same<decltype(std::scanf(" ")), int>::value), "");
+ static_assert((std::is_same<decltype(std::vscanf("",va)), int>::value), "");
+#endif
+
+#ifndef _LIBCPP_HAS_NO_STDOUT
+ static_assert((std::is_same<decltype(std::printf(" ")), int>::value), "");
+ static_assert((std::is_same<decltype(std::putchar(0)), int>::value), "");
+ static_assert((std::is_same<decltype(std::puts("")), int>::value), "");
+ static_assert((std::is_same<decltype(std::vprintf(" ",va)), int>::value), "");
+#endif
}
diff --git a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.pass.cpp b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.pass.cpp
index 9206d173fc0..cdf53f86277 100644
--- a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.pass.cpp
@@ -19,7 +19,11 @@ 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/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.pass.cpp b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.pass.cpp
index 3481598aed9..1ce04ffb156 100644
--- a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-has-no-stdin
+
// <iostream>
// istream cin;
@@ -23,6 +25,10 @@ int main()
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/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.pass.cpp b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.pass.cpp
index 6000ae274b9..e5887e1625d 100644
--- a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-has-no-stdout
+
// <iostream>
// istream cout;
diff --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr.pass.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr.pass.cpp
index 19a1dcdcdb4..b050781671e 100644
--- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr.pass.cpp
@@ -19,7 +19,11 @@ int main()
#if 0
std::wcerr << L"Hello World!\n";
#else
+#ifdef _LIBCPP_HAS_NO_STDOUT
+ assert(std::wcerr.tie() == NULL);
+#else
assert(std::wcerr.tie() == &std::wcout);
+#endif
assert(std::wcerr.flags() & std::ios_base::unitbuf);
#endif // 0
}
diff --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.pass.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.pass.cpp
index 90a56685a67..6abd6afa81c 100644
--- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-has-no-stdin
+
// <iostream>
// istream wcin;
@@ -23,6 +25,10 @@ int main()
std::wcin >> i;
std::wcout << L"The number is : " << i << L'\n';
#else // 0
+#ifdef _LIBCPP_HAS_NO_STDOUT
+ assert(std::wcin.tie() == NULL);
+#else
assert(std::wcin.tie() == &std::wcout);
#endif
+#endif
}
diff --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout.pass.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout.pass.cpp
index 7a546aa528d..6543e0aa56a 100644
--- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout.pass.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// XFAIL: libcpp-has-no-stdout
+
// <iostream>
// istream wcout;
OpenPOWER on IntegriCloud