[runtimes] Use int main(int, char**) consistently in tests

This is needed when running the tests in Freestanding mode, where main()
isn't treated specially. In Freestanding, main() doesn't get mangled as
extern "C", so whatever runtime we're using fails to find the entry point.

One way to solve this problem is to define a symbol alias from __Z4mainiPPc
to _main, however this requires all definitions of main() to have the same
mangling. Hence this commit.

GitOrigin-RevId: 504bc07d1afc7bad7b980a977141696ec8298e7e
diff --git a/test/backtrace_test.pass.cpp b/test/backtrace_test.pass.cpp
index 38125f8..77c447c 100644
--- a/test/backtrace_test.pass.cpp
+++ b/test/backtrace_test.pass.cpp
@@ -48,7 +48,7 @@
   call2(ntraced, do_throw);
 }
 
-int main() {
+int main(int, char**) {
   size_t throw_ntraced = 0;
   size_t nothrow_ntraced = 0;
 
diff --git a/test/catch_array_01.pass.cpp b/test/catch_array_01.pass.cpp
index f8bd4b1..74b4872 100644
--- a/test/catch_array_01.pass.cpp
+++ b/test/catch_array_01.pass.cpp
@@ -15,7 +15,7 @@
 
 #include <cassert>
 
-int main()
+int main(int, char**)
 {
     typedef char Array[4];
     Array a = {'H', 'i', '!', 0};
@@ -31,4 +31,6 @@
     catch (...)
     {
     }
+
+    return 0;
 }
diff --git a/test/catch_array_02.pass.cpp b/test/catch_array_02.pass.cpp
index 69cd8d5..ebdd0d9 100644
--- a/test/catch_array_02.pass.cpp
+++ b/test/catch_array_02.pass.cpp
@@ -11,7 +11,7 @@
 
 #include <cassert>
 
-int main()
+int main(int, char**)
 {
     typedef char Array[4];
     Array a = {'H', 'i', '!', 0};
@@ -27,4 +27,6 @@
     {
         assert(false);
     }
+
+    return 0;
 }
diff --git a/test/catch_class_01.pass.cpp b/test/catch_class_01.pass.cpp
index 2745840..56b84d6 100644
--- a/test/catch_class_01.pass.cpp
+++ b/test/catch_class_01.pass.cpp
@@ -43,7 +43,7 @@
     }
 }
 
-int main()
+int main(int, char**)
 {
     try
     {
@@ -56,4 +56,6 @@
         assert(a.id_ == 3);
     }
     assert(A::count == 0);
+
+    return 0;
 }
diff --git a/test/catch_class_02.pass.cpp b/test/catch_class_02.pass.cpp
index f78b581..9281102 100644
--- a/test/catch_class_02.pass.cpp
+++ b/test/catch_class_02.pass.cpp
@@ -67,7 +67,7 @@
     }
 }
 
-int main()
+int main(int, char**)
 {
     try
     {
@@ -81,4 +81,6 @@
     }
     assert(A::count == 0);
     assert(B::count == 0);
+
+    return 0;
 }
diff --git a/test/catch_class_03.pass.cpp b/test/catch_class_03.pass.cpp
index 450c13c..d7e1e76 100644
--- a/test/catch_class_03.pass.cpp
+++ b/test/catch_class_03.pass.cpp
@@ -181,7 +181,7 @@
     }
 }
 
-int main()
+int main(int, char**)
 {
     try
     {
@@ -195,4 +195,6 @@
     assert(C1::count == 0);
     assert(C2::count == 0);
     assert(B::count == 0);
+
+    return 0;
 }
diff --git a/test/catch_class_04.pass.cpp b/test/catch_class_04.pass.cpp
index a9656ec..174f07f 100644
--- a/test/catch_class_04.pass.cpp
+++ b/test/catch_class_04.pass.cpp
@@ -204,7 +204,7 @@
     }
 }
 
-int main()
+int main(int, char**)
 {
     try
     {
@@ -218,4 +218,6 @@
     assert(C1::count == 0);
     assert(C2::count == 0);
     assert(B::count == 0);
+
+    return 0;
 }
diff --git a/test/catch_const_pointer_nullptr.pass.cpp b/test/catch_const_pointer_nullptr.pass.cpp
index b910545..2389ba9 100644
--- a/test/catch_const_pointer_nullptr.pass.cpp
+++ b/test/catch_const_pointer_nullptr.pass.cpp
@@ -136,12 +136,13 @@
 
 #endif
 
-int main()
-{
+int main(int, char**) {
     test1();
     test2();
     test3();
     test4();
     test5();
     test6();
+
+    return 0;
 }
diff --git a/test/catch_function_01.pass.cpp b/test/catch_function_01.pass.cpp
index ca52c9e..bbc94ad 100644
--- a/test/catch_function_01.pass.cpp
+++ b/test/catch_function_01.pass.cpp
@@ -23,7 +23,7 @@
 
 void f() {}
 
-int main()
+int main(int, char**)
 {
     typedef void Function();
     assert(!can_convert<Function&>(&f));
@@ -48,4 +48,6 @@
     {
         assert(false);
     }
+
+    return 0;
 }
diff --git a/test/catch_function_02.pass.cpp b/test/catch_function_02.pass.cpp
index 1957711..c90b29c 100644
--- a/test/catch_function_02.pass.cpp
+++ b/test/catch_function_02.pass.cpp
@@ -13,7 +13,7 @@
 
 void f() {}
 
-int main()
+int main(int, char**)
 {
     typedef void Function();
     try
@@ -28,4 +28,6 @@
     {
         assert(false);
     }
+
+    return 0;
 }
diff --git a/test/catch_function_03.pass.cpp b/test/catch_function_03.pass.cpp
index 217500e..b321ecf 100644
--- a/test/catch_function_03.pass.cpp
+++ b/test/catch_function_03.pass.cpp
@@ -53,11 +53,13 @@
     }
 }
 
-int main()
+int main(int, char**)
 {
     check<false, false>();
     check<false, true>();
     check<true, false>();
     check<true, true>();
     check_deep();
+
+    return 0;
 }
diff --git a/test/catch_in_noexcept.pass.cpp b/test/catch_in_noexcept.pass.cpp
index fe3fc7d..6955f10 100644
--- a/test/catch_in_noexcept.pass.cpp
+++ b/test/catch_in_noexcept.pass.cpp
@@ -30,7 +30,9 @@
     assert(false);
 }
 
-int main()
+int main(int, char**)
 {
     f1();
+
+    return 0;
 }
diff --git a/test/catch_member_data_pointer_01.pass.cpp b/test/catch_member_data_pointer_01.pass.cpp
index 7653959..5fe9d59 100644
--- a/test/catch_member_data_pointer_01.pass.cpp
+++ b/test/catch_member_data_pointer_01.pass.cpp
@@ -164,11 +164,13 @@
     }
 }
 
-int main()
+int main(int, char**)
 {
     test1();
     test2();
     test3();
     test4();
     test5();
+
+    return 0;
 }
diff --git a/test/catch_member_function_pointer_01.pass.cpp b/test/catch_member_function_pointer_01.pass.cpp
index f1d4e8d..44ee925 100644
--- a/test/catch_member_function_pointer_01.pass.cpp
+++ b/test/catch_member_function_pointer_01.pass.cpp
@@ -161,10 +161,12 @@
     }
 }
 
-int main()
+int main(int, char**)
 {
     test1();
     test2();
     test_derived();
     test_void();
+
+    return 0;
 }
diff --git a/test/catch_member_function_pointer_02.pass.cpp b/test/catch_member_function_pointer_02.pass.cpp
index c38a930..d203fe3 100644
--- a/test/catch_member_function_pointer_02.pass.cpp
+++ b/test/catch_member_function_pointer_02.pass.cpp
@@ -60,11 +60,13 @@
     }
 }
 
-int main()
+int main(int, char**)
 {
     check<false, false>();
     check<false, true>();
     check<true, false>();
     check<true, true>();
     check_deep();
+
+    return 0;
 }
diff --git a/test/catch_member_pointer_nullptr.pass.cpp b/test/catch_member_pointer_nullptr.pass.cpp
index 54d4fd2..bbf1ecf 100644
--- a/test/catch_member_pointer_nullptr.pass.cpp
+++ b/test/catch_member_pointer_nullptr.pass.cpp
@@ -67,8 +67,10 @@
 
 #endif
 
-int main()
+int main(int, char**)
 {
     test1();
     test2();
+
+    return 0;
 }
diff --git a/test/catch_multi_level_pointer.pass.cpp b/test/catch_multi_level_pointer.pass.cpp
index be5a110..5aa0915 100644
--- a/test/catch_multi_level_pointer.pass.cpp
+++ b/test/catch_multi_level_pointer.pass.cpp
@@ -130,7 +130,7 @@
 template <class Throw, class Catch, int level>
 struct generate_tests : generate_tests_imp<Throw, Catch, level, true> {};
 
-int main()
+int main(int, char**)
 {
   generate_tests<int, int, 3>()();
   generate_tests<Base, Derived, 2>()();
@@ -141,4 +141,6 @@
   generate_tests<int A::*, int A::*, 3>()();
   generate_tests<int A::*, void, 2>()();
   generate_tests<void, int A::*, 2>()();
+
+  return 0;
 }
diff --git a/test/catch_pointer_nullptr.pass.cpp b/test/catch_pointer_nullptr.pass.cpp
index 3067e3c..6a8ed37 100644
--- a/test/catch_pointer_nullptr.pass.cpp
+++ b/test/catch_pointer_nullptr.pass.cpp
@@ -61,7 +61,7 @@
 }
 
 
-int main()
+int main(int, char**)
 {
   // catch naked nullptrs
   test1();
@@ -72,4 +72,6 @@
   catch_nullptr_test<int A::*>();
   catch_nullptr_test<const int A::*>();
   catch_nullptr_test<int A::**>();
+
+  return 0;
 }
diff --git a/test/catch_pointer_reference.pass.cpp b/test/catch_pointer_reference.pass.cpp
index 6ea0cae..5ebcc12 100644
--- a/test/catch_pointer_reference.pass.cpp
+++ b/test/catch_pointer_reference.pass.cpp
@@ -427,7 +427,7 @@
     assert_cannot_catch<const volatile Base * const volatile &, Protected *, Protected>();
 }
 
-int main()
+int main(int, char**)
 {
     f1();
     f2();
@@ -442,4 +442,6 @@
     f11();
     f12();
     f13();
+
+    return 0;
 }
diff --git a/test/catch_ptr.pass.cpp b/test/catch_ptr.pass.cpp
index b2d8999..5a409db 100644
--- a/test/catch_ptr.pass.cpp
+++ b/test/catch_ptr.pass.cpp
@@ -176,7 +176,7 @@
     }
 }
 
-int main()
+int main(int, char**)
 {
     try
     {
@@ -186,4 +186,6 @@
     catch (...)
     {
     }
+
+    return 0;
 }
diff --git a/test/catch_ptr_02.pass.cpp b/test/catch_ptr_02.pass.cpp
index d20076d..1908a49 100644
--- a/test/catch_ptr_02.pass.cpp
+++ b/test/catch_ptr_02.pass.cpp
@@ -198,7 +198,7 @@
     }
 }
 
-int main()
+int main(int, char**)
 {
     test1();
     test2();
@@ -210,4 +210,6 @@
     test8();
     test9();
     test10();
+
+    return 0;
 }
diff --git a/test/catch_reference_nullptr.pass.cpp b/test/catch_reference_nullptr.pass.cpp
index 5718bff..18bf235 100644
--- a/test/catch_reference_nullptr.pass.cpp
+++ b/test/catch_reference_nullptr.pass.cpp
@@ -25,7 +25,7 @@
   }
 }
 
-int main()
+int main(int, char**)
 {
   using nullptr_t = decltype(nullptr);
 
@@ -46,4 +46,6 @@
   catch_nullptr_test<int A::*, false>();
   catch_nullptr_test<int (A::*)(), false>();
 #endif
+
+  return 0;
 }
diff --git a/test/cxa_thread_atexit_test.pass.cpp b/test/cxa_thread_atexit_test.pass.cpp
index f167e3d..57783be 100644
--- a/test/cxa_thread_atexit_test.pass.cpp
+++ b/test/cxa_thread_atexit_test.pass.cpp
@@ -23,7 +23,7 @@
   return 4;
 }
 
-int main() {
+int main(int, char**) {
   int RV = __cxxabiv1::__cxa_thread_atexit(
       reinterpret_cast<void (*)(void *)>(1), reinterpret_cast<void *>(2),
       reinterpret_cast<void *>(3));
diff --git a/test/dynamic_cast.pass.cpp b/test/dynamic_cast.pass.cpp
index 429f3da..669814b 100644
--- a/test/dynamic_cast.pass.cpp
+++ b/test/dynamic_cast.pass.cpp
@@ -143,11 +143,13 @@
 
 }  // t5
 
-int main()
+int main(int, char**)
 {
     t1::test();
     t2::test();
     t3::test();
     t4::test();
     t5::test();
+
+    return 0;
 }
diff --git a/test/dynamic_cast14.pass.cpp b/test/dynamic_cast14.pass.cpp
index 57a4f26..1ca6b57 100644
--- a/test/dynamic_cast14.pass.cpp
+++ b/test/dynamic_cast14.pass.cpp
@@ -2172,10 +2172,12 @@
 
 }  // t3
 
-int main()
+int main(int, char**)
 {
     timer t;
     t1::test();
     t2::test();
     t3::test();
+
+    return 0;
 }
diff --git a/test/dynamic_cast3.pass.cpp b/test/dynamic_cast3.pass.cpp
index d569d5a..2aa8b03 100644
--- a/test/dynamic_cast3.pass.cpp
+++ b/test/dynamic_cast3.pass.cpp
@@ -1443,7 +1443,7 @@
 A1 A1
 |  |
 A2 |
- \ |  
+ \ |
   A3
 
 */
@@ -1926,7 +1926,7 @@
 A1
 | \
 A2 \
- \ |  
+ \ |
   A3
 
 */
@@ -2412,7 +2412,7 @@
 
 }  // t41
 
-int main()
+int main(int, char**)
 {
     timer t;
     t1::test();
@@ -2456,4 +2456,6 @@
     t39::test();
     t40::test();
     t41::test();
+
+    return 0;
 }
diff --git a/test/dynamic_cast5.pass.cpp b/test/dynamic_cast5.pass.cpp
index a8e6d96..4d6c94c 100644
--- a/test/dynamic_cast5.pass.cpp
+++ b/test/dynamic_cast5.pass.cpp
@@ -1305,7 +1305,7 @@
 }  // t9
 
 
-int main()
+int main(int, char**)
 {
     timer t;
     t1::test();
@@ -1317,4 +1317,6 @@
     t7::test();
     t8::test();
     t9::test();
+
+    return 0;
 }
diff --git a/test/dynamic_cast_stress.pass.cpp b/test/dynamic_cast_stress.pass.cpp
index b20cc85..1129fa1 100644
--- a/test/dynamic_cast_stress.pass.cpp
+++ b/test/dynamic_cast_stress.pass.cpp
@@ -63,9 +63,11 @@
     assert(b != 0);
 }
 
-int main()
+int main(int, char**)
 {
     test();
+
+    return 0;
 }
 
 /*
diff --git a/test/exception_object_alignment.2.pass.cpp b/test/exception_object_alignment.2.pass.cpp
index b35e728..1afa36e 100644
--- a/test/exception_object_alignment.2.pass.cpp
+++ b/test/exception_object_alignment.2.pass.cpp
@@ -24,7 +24,7 @@
 
 struct foo : exception { };
 
-int main() {
+int main(int, char**) {
     try {
       throw foo();
     } catch (...) {
diff --git a/test/exception_object_alignment.pass.cpp b/test/exception_object_alignment.pass.cpp
index df9f37b..011ba52 100644
--- a/test/exception_object_alignment.pass.cpp
+++ b/test/exception_object_alignment.pass.cpp
@@ -21,7 +21,7 @@
   int a[4];
 } __attribute__((aligned));
 
-int main() {
+int main(int, char**) {
 #if !defined(_LIBCXXABI_ARM_EHABI)
   void *p = __cxxabiv1::__cxa_allocate_exception(16);
   auto i = reinterpret_cast<uintptr_t>(p);
diff --git a/test/guard_test_basic.pass.cpp b/test/guard_test_basic.pass.cpp
index 0c10a65..e03dd18 100644
--- a/test/guard_test_basic.pass.cpp
+++ b/test/guard_test_basic.pass.cpp
@@ -109,7 +109,7 @@
 void NopFutexWake(int*) { assert(false); }
 uint32_t MockGetThreadID() { return 0; }
 
-int main() {
+int main(int, char**) {
   {
 #if defined(_LIBCXXABI_HAS_NO_THREADS)
     static_assert(CurrentImplementation == Implementation::NoThreads, "");
@@ -152,4 +152,6 @@
     Tests<uint32_t, FutexImpl>::test();
     Tests<uint64_t, FutexImpl>::test();
   }
+
+  return 0;
 }
diff --git a/test/guard_threaded_test.pass.cpp b/test/guard_threaded_test.pass.cpp
index d562b48..7e5e0de 100644
--- a/test/guard_threaded_test.pass.cpp
+++ b/test/guard_threaded_test.pass.cpp
@@ -375,9 +375,11 @@
   waker.join();
 }
 
-int main() {
+int main(int, char**) {
   // Test each multi-threaded implementation with real threads.
   test_all_impls();
   // Test the basic sanity of the futex syscall wrappers.
   test_futex_syscall();
+
+  return 0;
 }
diff --git a/test/incomplete_type.sh.cpp b/test/incomplete_type.sh.cpp
index 5521a10..cbcf753 100644
--- a/test/incomplete_type.sh.cpp
+++ b/test/incomplete_type.sh.cpp
@@ -83,7 +83,7 @@
 
 struct IncompleteAtThrow {};
 
-int main() {
+int main(int, char**) {
   AssertIncompleteTypeInfoEquals(ReturnTypeInfoNeverDefinedMP(), typeid(int NeverDefined::*));
   try {
     ThrowNeverDefinedMP();
@@ -205,7 +205,8 @@
     assert(!p);
   }
   catch(...) { assert(!"FAIL: Didn't catch nullptr as NeverDefined::*" ); }
-
 #endif
+
+  return 0;
 }
 #endif
diff --git a/test/inherited_exception.pass.cpp b/test/inherited_exception.pass.cpp
index ac92ab4..1e3089c 100644
--- a/test/inherited_exception.pass.cpp
+++ b/test/inherited_exception.pass.cpp
@@ -71,7 +71,7 @@
   throw static_cast<Base2*>(&child);
 }
 
-int main()
+int main(int, char**)
 {
     try
     {
@@ -170,4 +170,6 @@
     {
         assert(false);
     }
+
+    return 0;
 }
diff --git a/test/test_aux_runtime_op_array_new.pass.cpp b/test/test_aux_runtime_op_array_new.pass.cpp
index 928e324..cc73c3c 100644
--- a/test/test_aux_runtime_op_array_new.pass.cpp
+++ b/test/test_aux_runtime_op_array_new.pass.cpp
@@ -27,7 +27,7 @@
     return false;
 }
 
-int main() {
+int main(int, char**) {
     int ret_val = 0;
 
     if ( !bad_array_new_length_test ()) {
diff --git a/test/test_demangle.pass.cpp b/test/test_demangle.pass.cpp
index fd84d3b..f72b2ea 100644
--- a/test/test_demangle.pass.cpp
+++ b/test/test_demangle.pass.cpp
@@ -30006,7 +30006,7 @@
     free(buf);
 }
 
-int main()
+int main(int, char**)
 {
     std::cout << "Testing " << N << " symbols." << std::endl;
     {
@@ -30050,4 +30050,6 @@
         std::cout << '\n';
     }
 #endif
+
+    return 0;
 }
diff --git a/test/test_exception_address_alignment.pass.cpp b/test/test_exception_address_alignment.pass.cpp
index 92652f4..1b7316b 100644
--- a/test/test_exception_address_alignment.pass.cpp
+++ b/test/test_exception_address_alignment.pass.cpp
@@ -41,7 +41,7 @@
 struct MinAligned {  };
 static_assert(alignof(MinAligned) == 1 && sizeof(MinAligned) == 1, "");
 
-int main() {
+int main(int, char**) {
   for (int i=0; i < 10; ++i) {
     try {
       throw MinAligned{};
@@ -49,4 +49,6 @@
       assert(reinterpret_cast<uintptr_t>(&ref) % EXPECTED_ALIGNMENT == 0);
     }
   }
+
+  return 0;
 }
diff --git a/test/test_guard.pass.cpp b/test/test_guard.pass.cpp
index 8c96ae8..2168986 100644
--- a/test/test_guard.pass.cpp
+++ b/test/test_guard.pass.cpp
@@ -136,7 +136,7 @@
 }
 #endif /* _LIBCXXABI_HAS_NO_THREADS */
 
-int main()
+int main(int, char**)
 {
     test1::test();
     test2::test();
@@ -145,4 +145,6 @@
     test4::test();
     test5::test();
 #endif
+
+    return 0;
 }
diff --git a/test/test_vector3.pass.cpp b/test/test_vector3.pass.cpp
index 9b7e671..928788f 100644
--- a/test/test_vector3.pass.cpp
+++ b/test/test_vector3.pass.cpp
@@ -47,7 +47,7 @@
   t->~T();
 }
 
-int main()
+int main(int, char**)
 {
   std::set_terminate(my_terminate);
   {
@@ -56,4 +56,6 @@
   __cxxabiv1::__cxa_vec_dtor(a, 10, sizeof(test1::A), destroy<test1::A>);
   assert(false);
   }
+
+  return 0;
 }
diff --git a/test/thread_local_destruction_order.pass.cpp b/test/thread_local_destruction_order.pass.cpp
index 9bf1aa7..eeb90b8 100644
--- a/test/thread_local_destruction_order.pass.cpp
+++ b/test/thread_local_destruction_order.pass.cpp
@@ -56,7 +56,7 @@
   thread_local CreatesThreadLocalInDestructor<0> creates_tl0;
 }
 
-int main() {
+int main(int, char**) {
   static OrderChecker fn_static{6};
 
   std::thread{thread_fn}.join();
diff --git a/test/unittest_demangle.pass.cpp b/test/unittest_demangle.pass.cpp
index 5c08956..3767256 100644
--- a/test/unittest_demangle.pass.cpp
+++ b/test/unittest_demangle.pass.cpp
@@ -81,6 +81,7 @@
   }
 }
 
-int main() {
+int main(int, char**) {
   testPODSmallVector();
+  return 0;
 }
diff --git a/test/unwind_01.pass.cpp b/test/unwind_01.pass.cpp
index f715961..5a1abc6 100644
--- a/test/unwind_01.pass.cpp
+++ b/test/unwind_01.pass.cpp
@@ -72,7 +72,7 @@
     C c;
 }
 
-int main()
+int main(int, char**)
 {
     try
     {
@@ -98,4 +98,6 @@
     assert(A::count == 0);
     assert(B::count == 0);
     assert(C::count == 0);
+
+    return 0;
 }
diff --git a/test/unwind_02.pass.cpp b/test/unwind_02.pass.cpp
index 3442bb5..050e4af 100644
--- a/test/unwind_02.pass.cpp
+++ b/test/unwind_02.pass.cpp
@@ -73,7 +73,7 @@
     C c;
 }
 
-int main()
+int main(int, char**)
 {
     try
     {
@@ -99,4 +99,6 @@
     assert(A::count == 0);
     assert(B::count == 0);
     assert(C::count == 0);
+
+    return 0;
 }
diff --git a/test/unwind_03.pass.cpp b/test/unwind_03.pass.cpp
index 482791d..154fb6e 100644
--- a/test/unwind_03.pass.cpp
+++ b/test/unwind_03.pass.cpp
@@ -80,7 +80,7 @@
     exit(0);
 }
 
-int main()
+int main(int, char**)
 {
     std::set_unexpected(u_handler);
     try
@@ -105,4 +105,6 @@
         assert(false);
     }
     assert(false);
+
+    return 0;
 }
diff --git a/test/unwind_04.pass.cpp b/test/unwind_04.pass.cpp
index 069ca37..d85434d 100644
--- a/test/unwind_04.pass.cpp
+++ b/test/unwind_04.pass.cpp
@@ -80,7 +80,7 @@
     throw 'a';
 }
 
-int main()
+int main(int, char**)
 {
     std::set_unexpected(u_handler);
     try
@@ -111,4 +111,6 @@
     assert(A::count == 0);
     assert(B::count == 0);
     assert(C::count == 0);
+
+    return 0;
 }
diff --git a/test/unwind_05.pass.cpp b/test/unwind_05.pass.cpp
index 9172a02..2f9f8da 100644
--- a/test/unwind_05.pass.cpp
+++ b/test/unwind_05.pass.cpp
@@ -80,7 +80,7 @@
     throw;
 }
 
-int main()
+int main(int, char**)
 {
     std::set_unexpected(u_handler);
     try
@@ -115,4 +115,6 @@
     assert(A::count == 0);
     assert(B::count == 0);
     assert(C::count == 0);
+
+    return 0;
 }
diff --git a/test/unwind_06.pass.cpp b/test/unwind_06.pass.cpp
index 1bcb89c..c4f23d8 100644
--- a/test/unwind_06.pass.cpp
+++ b/test/unwind_06.pass.cpp
@@ -252,7 +252,7 @@
 
 
 
-int main()
-{
+int main(int, char**) {
   foo();
+  return 0;
 }