summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/diagnostics/syserr
diff options
context:
space:
mode:
authorJF Bastien <jfbastien@apple.com>2019-02-04 20:31:13 +0000
committerJF Bastien <jfbastien@apple.com>2019-02-04 20:31:13 +0000
commit2df59c50688c122bbcae7467d3eaf862c3ea3088 (patch)
tree29c9a3e1c54fe76a506ffecc0cc4d8fbaba5cb04 /libcxx/test/std/diagnostics/syserr
parent6fd4e7fe0258ff71fe759535236883ea9060587c (diff)
downloadbcm5719-llvm-2df59c50688c122bbcae7467d3eaf862c3ea3088.tar.gz
bcm5719-llvm-2df59c50688c122bbcae7467d3eaf862c3ea3088.zip
Support tests in freestanding
Summary: Freestanding is *weird*. The standard allows it to differ in a bunch of odd manners from regular C++, and the committee would like to improve that situation. I'd like to make libc++ behave better with what freestanding should be, so that it can be a tool we use in improving the standard. To do that we need to try stuff out, both with "freestanding the language mode" and "freestanding the library subset". Let's start with the super basic: run the libc++ tests in freestanding, using clang as the compiler, and see what works. The easiest hack to do this: In utils/libcxx/test/config.py add: self.cxx.compile_flags += ['-ffreestanding'] Run the tests and they all fail. Why? Because in freestanding `main` isn't special. This "not special" property has two effects: main doesn't get mangled, and main isn't allowed to omit its `return` statement. The first means main gets mangled and the linker can't create a valid executable for us to test. The second means we spew out warnings (ew) and the compiler doesn't insert the `return` we omitted, and main just falls of the end and does whatever undefined behavior (if you're luck, ud2 leading to non-zero return code). Let's start my work with the basics. This patch changes all libc++ tests to declare `main` as `int main(int, char**` so it mangles consistently (enabling us to declare another `extern "C"` main for freestanding which calls the mangled one), and adds `return 0;` to all places where it was missing. This touches 6124 files, and I apologize. The former was done with The Magic Of Sed. The later was done with a (not quite correct but decent) clang tool: https://gist.github.com/jfbastien/793819ff360baa845483dde81170feed This works for most tests, though I did have to adjust a few places when e.g. the test runs with `-x c`, macros are used for main (such as for the filesystem tests), etc. Once this is in we can create a freestanding bot which will prevent further regressions. After that, we can start the real work of supporting C++ freestanding fairly well in libc++. <rdar://problem/47754795> Reviewers: ldionne, mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, arphaman, miyuki, libcxx-commits Differential Revision: https://reviews.llvm.org/D57624 llvm-svn: 353086
Diffstat (limited to 'libcxx/test/std/diagnostics/syserr')
-rw-r--r--libcxx/test/std/diagnostics/syserr/errc.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/is_error_code_enum.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/is_error_condition_enum.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.compare/eq_error_code_error_code.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcat/nothing_to_do.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.derived/message.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/default_ctor.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/eq.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/lt.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/neq.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.overview/error_category.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/default_error_condition.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_error_code_int.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_int_error_condition.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcode/nothing_to_do.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/ErrorCodeEnum.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/default.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/int_error_category.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/ErrorCodeEnum.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/assign.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/clear.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/lt.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/make_error_code.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/stream_inserter.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/bool.fail.cpp2
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/bool.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/category.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/default_error_condition.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/message.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/value.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/types.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcondition/nothing_to_do.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/ErrorConditionEnum.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/default.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/int_error_category.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/ErrorConditionEnum.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/assign.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/clear.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/lt.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/make_error_condition.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/bool.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/category.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/message.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/value.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/types.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.hash/enabled_hash.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.hash/error_condition.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.syserr/nothing_to_do.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code_const_char_pointer.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code_string.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category_const_char_pointer.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category_string.pass.cpp4
-rw-r--r--libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.overview/nothing_to_do.pass.cpp4
58 files changed, 172 insertions, 58 deletions
diff --git a/libcxx/test/std/diagnostics/syserr/errc.pass.cpp b/libcxx/test/std/diagnostics/syserr/errc.pass.cpp
index 0738264afdb..201878d2dd5 100644
--- a/libcxx/test/std/diagnostics/syserr/errc.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/errc.pass.cpp
@@ -12,7 +12,7 @@
#include <system_error>
-int main()
+int main(int, char**)
{
static_assert(static_cast<int>(std::errc::address_family_not_supported) == EAFNOSUPPORT, "");
static_assert(static_cast<int>(std::errc::address_in_use) == EADDRINUSE, "");
@@ -100,4 +100,6 @@ int main()
static_assert(static_cast<int>(std::errc::too_many_symbolic_link_levels) == ELOOP, "");
static_assert(static_cast<int>(std::errc::value_too_large) == EOVERFLOW, "");
static_assert(static_cast<int>(std::errc::wrong_protocol_type) == EPROTOTYPE, "");
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/is_error_code_enum.pass.cpp b/libcxx/test/std/diagnostics/syserr/is_error_code_enum.pass.cpp
index 2b1416e15d6..2a44b5ee352 100644
--- a/libcxx/test/std/diagnostics/syserr/is_error_code_enum.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/is_error_code_enum.pass.cpp
@@ -39,7 +39,7 @@ namespace std
}
-int main()
+int main(int, char**)
{
test<false, void>();
test<false, int>();
@@ -47,4 +47,6 @@ int main()
test<false, std::string>();
test<true, A>();
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/is_error_condition_enum.pass.cpp b/libcxx/test/std/diagnostics/syserr/is_error_condition_enum.pass.cpp
index 8398c70febb..df89fc334b2 100644
--- a/libcxx/test/std/diagnostics/syserr/is_error_condition_enum.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/is_error_condition_enum.pass.cpp
@@ -39,7 +39,7 @@ namespace std
}
-int main()
+int main(int, char**)
{
test<false, void>();
test<false, int>();
@@ -47,4 +47,6 @@ int main()
test<false, std::string>();
test<true, A>();
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.compare/eq_error_code_error_code.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.compare/eq_error_code_error_code.pass.cpp
index 425406ade46..0e2dbe552bd 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.compare/eq_error_code_error_code.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.compare/eq_error_code_error_code.pass.cpp
@@ -20,7 +20,7 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
std::error_code e_code1(5, std::generic_category());
std::error_code e_code2(5, std::system_category());
@@ -102,4 +102,6 @@ int main()
assert(e_condition4 != e_condition2);
assert(e_condition4 != e_condition3);
assert(e_condition4 == e_condition4);
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcat/nothing_to_do.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcat/nothing_to_do.pass.cpp
index f77636c8475..1f764da05d6 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcat/nothing_to_do.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcat/nothing_to_do.pass.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
-int main()
+int main(int, char**)
{
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.derived/message.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.derived/message.pass.cpp
index 8aa7fedf6f8..ed580198efc 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.derived/message.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.derived/message.pass.cpp
@@ -18,7 +18,7 @@
#include <stdio.h>
-int main()
+int main(int, char**)
{
const std::error_category& e_cat1 = std::generic_category();
const std::error_category& e_cat2 = std::system_category();
@@ -30,4 +30,6 @@ int main()
assert(!m3.empty());
assert(m1 == m2);
assert(m1 != m3);
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/default_ctor.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/default_ctor.pass.cpp
index 8e5bda76297..185f96e26eb 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/default_ctor.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/default_ctor.pass.cpp
@@ -27,8 +27,10 @@ public:
virtual std::string message(int) const {return std::string();}
};
-int main()
+int main(int, char**)
{
static_assert(std::is_nothrow_default_constructible<test1>::value,
"error_category() must exist and be noexcept");
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/eq.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/eq.pass.cpp
index abe0c36873f..ce09481e324 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/eq.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/eq.pass.cpp
@@ -15,11 +15,13 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
const std::error_category& e_cat1 = std::generic_category();
const std::error_category& e_cat2 = std::generic_category();
const std::error_category& e_cat3 = std::system_category();
assert(e_cat1 == e_cat2);
assert(!(e_cat1 == e_cat3));
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/lt.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/lt.pass.cpp
index 9b9a1acc0f2..db6b3b90814 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/lt.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/lt.pass.cpp
@@ -15,11 +15,13 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
const std::error_category& e_cat1 = std::generic_category();
const std::error_category& e_cat2 = std::generic_category();
const std::error_category& e_cat3 = std::system_category();
assert(!(e_cat1 < e_cat2) && !(e_cat2 < e_cat1));
assert((e_cat1 < e_cat3) || (e_cat3 < e_cat1));
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/neq.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/neq.pass.cpp
index 615c9a0bec6..2826018d3d5 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/neq.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/neq.pass.cpp
@@ -15,11 +15,13 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
const std::error_category& e_cat1 = std::generic_category();
const std::error_category& e_cat2 = std::generic_category();
const std::error_category& e_cat3 = std::system_category();
assert(!(e_cat1 != e_cat2));
assert(e_cat1 != e_cat3);
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
index 73967e90f42..f04427381cb 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
@@ -35,7 +35,7 @@ void test_message_for_bad_value() {
assert(errno == E2BIG);
}
-int main()
+int main(int, char**)
{
const std::error_category& e_cat1 = std::generic_category();
std::string m1 = e_cat1.name();
@@ -43,4 +43,6 @@ int main()
{
test_message_for_bad_value();
}
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
index 78d3a3ef00c..8374c8766b2 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
@@ -35,7 +35,7 @@ void test_message_for_bad_value() {
assert(errno == E2BIG);
}
-int main()
+int main(int, char**)
{
const std::error_category& e_cat1 = std::system_category();
std::error_condition e_cond = e_cat1.default_error_condition(5);
@@ -47,4 +47,6 @@ int main()
{
test_message_for_bad_value();
}
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.overview/error_category.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.overview/error_category.pass.cpp
index b75b6b92437..112c3944885 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.overview/error_category.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.overview/error_category.pass.cpp
@@ -12,8 +12,10 @@
#include <system_error>
-int main()
+int main(int, char**)
{
std::error_category* p = 0;
((void)p);
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/default_error_condition.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/default_error_condition.pass.cpp
index 870822cbcbe..07daf6f4912 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/default_error_condition.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/default_error_condition.pass.cpp
@@ -15,10 +15,12 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
const std::error_category& e_cat = std::generic_category();
std::error_condition e_cond = e_cat.default_error_condition(static_cast<int>(std::errc::not_a_directory));
assert(e_cond.category() == e_cat);
assert(e_cond.value() == static_cast<int>(std::errc::not_a_directory));
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_error_code_int.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_error_code_int.pass.cpp
index 89eb8b47523..7682227980e 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_error_code_int.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_error_code_int.pass.cpp
@@ -15,9 +15,11 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
const std::error_category& e_cat = std::generic_category();
assert(e_cat.equivalent(std::error_code(5, e_cat), 5));
assert(!e_cat.equivalent(std::error_code(5, e_cat), 6));
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_int_error_condition.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_int_error_condition.pass.cpp
index 76cc198382b..7e627d4097a 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_int_error_condition.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.virtuals/equivalent_int_error_condition.pass.cpp
@@ -15,10 +15,12 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
const std::error_category& e_cat = std::generic_category();
std::error_condition e_cond = e_cat.default_error_condition(5);
assert(e_cat.equivalent(5, e_cond));
assert(!e_cat.equivalent(6, e_cond));
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcode/nothing_to_do.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcode/nothing_to_do.pass.cpp
index f77636c8475..1f764da05d6 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcode/nothing_to_do.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcode/nothing_to_do.pass.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
-int main()
+int main(int, char**)
{
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/ErrorCodeEnum.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/ErrorCodeEnum.pass.cpp
index 50f48e170bc..bfebd012b8d 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/ErrorCodeEnum.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/ErrorCodeEnum.pass.cpp
@@ -33,11 +33,13 @@ make_error_code(testing x)
return std::error_code(static_cast<int>(x), std::generic_category());
}
-int main()
+int main(int, char**)
{
{
std::error_code ec(two);
assert(ec.value() == 2);
assert(ec.category() == std::generic_category());
}
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/default.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/default.pass.cpp
index 9d7fbba1dfb..3a7249edeae 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/default.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/default.pass.cpp
@@ -15,9 +15,11 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
std::error_code ec;
assert(ec.value() == 0);
assert(ec.category() == std::system_category());
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/int_error_category.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/int_error_category.pass.cpp
index 99d8f940768..5a2150fbf7f 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/int_error_category.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.constructors/int_error_category.pass.cpp
@@ -15,7 +15,7 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
{
std::error_code ec(6, std::system_category());
@@ -27,4 +27,6 @@ int main()
assert(ec.value() == 8);
assert(ec.category() == std::generic_category());
}
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/ErrorCodeEnum.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/ErrorCodeEnum.pass.cpp
index aa99f4b3a89..a98e2294456 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/ErrorCodeEnum.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/ErrorCodeEnum.pass.cpp
@@ -33,7 +33,7 @@ make_error_code(testing x)
return std::error_code(static_cast<int>(x), std::generic_category());
}
-int main()
+int main(int, char**)
{
{
std::error_code ec;
@@ -41,4 +41,6 @@ int main()
assert(ec.value() == 2);
assert(ec.category() == std::generic_category());
}
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/assign.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/assign.pass.cpp
index 2c06d4b9379..998cfd3545e 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/assign.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/assign.pass.cpp
@@ -15,7 +15,7 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
{
std::error_code ec;
@@ -29,4 +29,6 @@ int main()
assert(ec.value() == 8);
assert(ec.category() == std::generic_category());
}
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/clear.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/clear.pass.cpp
index 523562c8e25..c4b7eca258a 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/clear.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/clear.pass.cpp
@@ -15,7 +15,7 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
{
std::error_code ec;
@@ -26,4 +26,6 @@ int main()
assert(ec.value() == 0);
assert(ec.category() == std::system_category());
}
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/lt.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/lt.pass.cpp
index 98f46eea650..9dc37fc3425 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/lt.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/lt.pass.cpp
@@ -16,11 +16,13 @@
#include <string>
#include <cassert>
-int main()
+int main(int, char**)
{
{
const std::error_code ec1(6, std::generic_category());
const std::error_code ec2(7, std::generic_category());
assert(ec1 < ec2);
}
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/make_error_code.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/make_error_code.pass.cpp
index 7917de06e59..1f4603f7c98 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/make_error_code.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/make_error_code.pass.cpp
@@ -15,11 +15,13 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
{
std::error_code ec = make_error_code(std::errc::operation_canceled);
assert(ec.value() == static_cast<int>(std::errc::operation_canceled));
assert(ec.category() == std::generic_category());
}
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/stream_inserter.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/stream_inserter.pass.cpp
index 0828c1fb8e5..37e1d817dbb 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/stream_inserter.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.nonmembers/stream_inserter.pass.cpp
@@ -18,9 +18,11 @@
#include <sstream>
#include <cassert>
-int main()
+int main(int, char**)
{
std::ostringstream out;
out << std::error_code(std::io_errc::stream);
assert(out.str() == "iostream:1");
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/bool.fail.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/bool.fail.cpp
index 6b9838ca73d..902e108a1c1 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/bool.fail.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/bool.fail.cpp
@@ -22,7 +22,7 @@ bool test_func(void)
return ec; // conversion to bool is explicit; should fail.
}
-int main()
+int main(int, char**)
{
return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/bool.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/bool.pass.cpp
index da226788c21..11bea5a344e 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/bool.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/bool.pass.cpp
@@ -16,7 +16,7 @@
#include <string>
#include <cassert>
-int main()
+int main(int, char**)
{
{
const std::error_code ec(6, std::generic_category());
@@ -26,4 +26,6 @@ int main()
const std::error_code ec(0, std::generic_category());
assert(!static_cast<bool>(ec));
}
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/category.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/category.pass.cpp
index a2a9ef717b2..16197d934a0 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/category.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/category.pass.cpp
@@ -15,8 +15,10 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
const std::error_code ec(6, std::generic_category());
assert(ec.category() == std::generic_category());
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/default_error_condition.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/default_error_condition.pass.cpp
index e7119a3e671..4c92b488e20 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/default_error_condition.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/default_error_condition.pass.cpp
@@ -15,7 +15,7 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
{
const std::error_code ec(6, std::generic_category());
@@ -27,4 +27,6 @@ int main()
std::error_condition e_cond = ec.default_error_condition();
assert(e_cond == ec);
}
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/message.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/message.pass.cpp
index 7482914e672..513eeae77d5 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/message.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/message.pass.cpp
@@ -16,8 +16,10 @@
#include <string>
#include <cassert>
-int main()
+int main(int, char**)
{
const std::error_code ec(6, std::generic_category());
assert(ec.message() == std::generic_category().message(6));
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/value.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/value.pass.cpp
index 5e15e06300d..f1fcee41469 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/value.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/value.pass.cpp
@@ -15,8 +15,10 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
const std::error_code ec(6, std::system_category());
assert(ec.value() == 6);
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/types.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/types.pass.cpp
index c5f8650d2f5..b2441ac9746 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/types.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/types.pass.cpp
@@ -14,10 +14,12 @@
#include <system_error>
#include "test_macros.h"
-int main()
+int main(int, char**)
{
std::error_code x;
TEST_IGNORE_NODISCARD x.category(); // returns a std::error_category &
TEST_IGNORE_NODISCARD x.default_error_condition(); // std::error_condition
TEST_IGNORE_NODISCARD x.message(); // returns a std::string
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/nothing_to_do.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/nothing_to_do.pass.cpp
index f77636c8475..1f764da05d6 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/nothing_to_do.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/nothing_to_do.pass.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
-int main()
+int main(int, char**)
{
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/ErrorConditionEnum.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/ErrorConditionEnum.pass.cpp
index 34c3af883d5..63e718dda30 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/ErrorConditionEnum.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/ErrorConditionEnum.pass.cpp
@@ -15,11 +15,13 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
{
std::error_condition ec(std::errc::not_a_directory);
assert(ec.value() == static_cast<int>(std::errc::not_a_directory));
assert(ec.category() == std::generic_category());
}
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/default.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/default.pass.cpp
index e303920102e..f39904a12e8 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/default.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/default.pass.cpp
@@ -15,9 +15,11 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
std::error_condition ec;
assert(ec.value() == 0);
assert(ec.category() == std::generic_category());
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/int_error_category.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/int_error_category.pass.cpp
index 82b0de8b6cf..b30c23f1913 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/int_error_category.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.constructors/int_error_category.pass.cpp
@@ -15,7 +15,7 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
{
std::error_condition ec(6, std::system_category());
@@ -27,4 +27,6 @@ int main()
assert(ec.value() == 8);
assert(ec.category() == std::generic_category());
}
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/ErrorConditionEnum.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/ErrorConditionEnum.pass.cpp
index 0cefa6e3283..129e30e3fa3 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/ErrorConditionEnum.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/ErrorConditionEnum.pass.cpp
@@ -15,7 +15,7 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
{
std::error_condition ec;
@@ -23,4 +23,6 @@ int main()
assert(ec.value() == static_cast<int>(std::errc::not_enough_memory));
assert(ec.category() == std::generic_category());
}
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/assign.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/assign.pass.cpp
index 44ff3f67eff..a0e27ee5e77 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/assign.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/assign.pass.cpp
@@ -15,7 +15,7 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
{
std::error_condition ec;
@@ -29,4 +29,6 @@ int main()
assert(ec.value() == 8);
assert(ec.category() == std::generic_category());
}
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/clear.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/clear.pass.cpp
index 9dd5bf3035f..5de51aa954a 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/clear.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.modifiers/clear.pass.cpp
@@ -15,7 +15,7 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
{
std::error_condition ec;
@@ -26,4 +26,6 @@ int main()
assert(ec.value() == 0);
assert(ec.category() == std::generic_category());
}
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/lt.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/lt.pass.cpp
index ce57687518e..f1c24514b60 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/lt.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/lt.pass.cpp
@@ -16,11 +16,13 @@
#include <string>
#include <cassert>
-int main()
+int main(int, char**)
{
{
const std::error_condition ec1(6, std::generic_category());
const std::error_condition ec2(7, std::generic_category());
assert(ec1 < ec2);
}
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/make_error_condition.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/make_error_condition.pass.cpp
index 6f64e49bfe7..e9e65db5965 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/make_error_condition.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.nonmembers/make_error_condition.pass.cpp
@@ -15,11 +15,13 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
{
const std::error_condition ec1 = std::make_error_condition(std::errc::message_size);
assert(ec1.value() == static_cast<int>(std::errc::message_size));
assert(ec1.category() == std::generic_category());
}
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/bool.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/bool.pass.cpp
index 8684393dfd1..bccdf5fb0ac 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/bool.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/bool.pass.cpp
@@ -16,7 +16,7 @@
#include <string>
#include <cassert>
-int main()
+int main(int, char**)
{
{
const std::error_condition ec(6, std::generic_category());
@@ -26,4 +26,6 @@ int main()
const std::error_condition ec(0, std::generic_category());
assert(!static_cast<bool>(ec));
}
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/category.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/category.pass.cpp
index d5bbc94b302..f4710a7226c 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/category.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/category.pass.cpp
@@ -15,8 +15,10 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
const std::error_condition ec(6, std::generic_category());
assert(ec.category() == std::generic_category());
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/message.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/message.pass.cpp
index c5fc8c60a95..e533e84ee4b 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/message.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/message.pass.cpp
@@ -16,8 +16,10 @@
#include <string>
#include <cassert>
-int main()
+int main(int, char**)
{
const std::error_condition ec(6, std::generic_category());
assert(ec.message() == std::generic_category().message(6));
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/value.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/value.pass.cpp
index 03038e1c830..d78b1787492 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/value.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.observers/value.pass.cpp
@@ -15,8 +15,10 @@
#include <system_error>
#include <cassert>
-int main()
+int main(int, char**)
{
const std::error_condition ec(6, std::system_category());
assert(ec.value() == 6);
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/types.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/types.pass.cpp
index f6376d523e3..85a0155d75d 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/types.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/types.pass.cpp
@@ -14,9 +14,11 @@
#include <system_error>
#include "test_macros.h"
-int main()
+int main(int, char**)
{
std::error_condition x = std::errc(0);
TEST_IGNORE_NODISCARD x.category(); // returns a std::error_condition &
TEST_IGNORE_NODISCARD x.message(); // returns a std::string
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.hash/enabled_hash.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.hash/enabled_hash.pass.cpp
index 6be7b4e9c12..c127e900a1c 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.hash/enabled_hash.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.hash/enabled_hash.pass.cpp
@@ -17,10 +17,12 @@
#include "poisoned_hash_helper.hpp"
-int main() {
+int main(int, char**) {
test_library_hash_specializations_available();
{
test_hash_enabled_for_type<std::error_code>();
test_hash_enabled_for_type<std::error_condition>();
}
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
index 0158f3ff31d..f8c09775f23 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
@@ -36,9 +36,11 @@ test(int i)
((void)result); // Prevent unused warning
}
-int main()
+int main(int, char**)
{
test(0);
test(2);
test(10);
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.hash/error_condition.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.hash/error_condition.pass.cpp
index d651e6d5c6d..b9b0057b98f 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.hash/error_condition.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.hash/error_condition.pass.cpp
@@ -36,9 +36,11 @@ test(int i)
((void)result); // Prevent unused warning
}
-int main()
+int main(int, char**)
{
test(0);
test(2);
test(10);
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.syserr/nothing_to_do.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.syserr/nothing_to_do.pass.cpp
index f77636c8475..1f764da05d6 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.syserr/nothing_to_do.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.syserr/nothing_to_do.pass.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
-int main()
+int main(int, char**)
{
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code.pass.cpp
index 4d59735fe94..3e721c2d2e2 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code.pass.cpp
@@ -18,11 +18,13 @@
#include <string>
#include <cassert>
-int main()
+int main(int, char**)
{
std::system_error se(static_cast<int>(std::errc::not_a_directory),
std::generic_category(), "some text");
assert(se.code() == std::make_error_code(std::errc::not_a_directory));
std::string what_message(se.what());
assert(what_message.find("Not a directory") != std::string::npos);
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code_const_char_pointer.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code_const_char_pointer.pass.cpp
index c2b229a9df9..d15ff75bf9c 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code_const_char_pointer.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code_const_char_pointer.pass.cpp
@@ -18,7 +18,7 @@
#include <string>
#include <cassert>
-int main()
+int main(int, char**)
{
std::string what_arg("test message");
std::system_error se(make_error_code(std::errc::not_a_directory), what_arg.c_str());
@@ -26,4 +26,6 @@ int main()
std::string what_message(se.what());
assert(what_message.find(what_arg) != std::string::npos);
assert(what_message.find("Not a directory") != std::string::npos);
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code_string.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code_string.pass.cpp
index adca00d1eb6..8e2b078005c 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code_string.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_error_code_string.pass.cpp
@@ -18,7 +18,7 @@
#include <string>
#include <cassert>
-int main()
+int main(int, char**)
{
std::string what_arg("test message");
std::system_error se(make_error_code(std::errc::not_a_directory), what_arg);
@@ -26,4 +26,6 @@ int main()
std::string what_message(se.what());
assert(what_message.find(what_arg) != std::string::npos);
assert(what_message.find("Not a directory") != std::string::npos);
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category.pass.cpp
index d77d20cfe3c..b1ac08e666d 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category.pass.cpp
@@ -18,11 +18,13 @@
#include <string>
#include <cassert>
-int main()
+int main(int, char**)
{
std::system_error se(static_cast<int>(std::errc::not_a_directory),
std::generic_category());
assert(se.code() == std::make_error_code(std::errc::not_a_directory));
std::string what_message(se.what());
assert(what_message.find("Not a directory") != std::string::npos);
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category_const_char_pointer.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category_const_char_pointer.pass.cpp
index 789fed6b62f..a6d24326783 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category_const_char_pointer.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category_const_char_pointer.pass.cpp
@@ -18,7 +18,7 @@
#include <string>
#include <cassert>
-int main()
+int main(int, char**)
{
std::string what_arg("test message");
std::system_error se(static_cast<int>(std::errc::not_a_directory),
@@ -27,4 +27,6 @@ int main()
std::string what_message(se.what());
assert(what_message.find(what_arg) != std::string::npos);
assert(what_message.find("Not a directory") != std::string::npos);
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category_string.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category_string.pass.cpp
index 29df242f0e2..913c675b9a1 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category_string.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.members/ctor_int_error_category_string.pass.cpp
@@ -18,7 +18,7 @@
#include <string>
#include <cassert>
-int main()
+int main(int, char**)
{
std::string what_arg("test message");
std::system_error se(static_cast<int>(std::errc::not_a_directory),
@@ -27,4 +27,6 @@ int main()
std::string what_message(se.what());
assert(what_message.find(what_arg) != std::string::npos);
assert(what_message.find("Not a directory") != std::string::npos);
+
+ return 0;
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.overview/nothing_to_do.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.overview/nothing_to_do.pass.cpp
index f77636c8475..1f764da05d6 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.overview/nothing_to_do.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.syserr/syserr.syserr.overview/nothing_to_do.pass.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
-int main()
+int main(int, char**)
{
+
+ return 0;
}
OpenPOWER on IntegriCloud