浏览代码

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@353086 91177308-0d34-0410-b5e6-96231b3b80d8
JF Bastien 6 年之前
父节点
当前提交
e15dd4e32e
共有 100 个文件被更改,包括 307 次插入118 次删除
  1. 1 1
      cmake/Modules/CheckLibcxxAtomic.cmake
  2. 1 1
      docs/DesignDocs/DebugMode.rst
  3. 2 1
      docs/DesignDocs/FileTimeType.rst
  4. 3 1
      test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.cxx1z.pass.cpp
  5. 3 1
      test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.fail.cpp
  6. 3 1
      test/libcxx/algorithms/debug_less.pass.cpp
  7. 3 1
      test/libcxx/algorithms/half_positive.pass.cpp
  8. 3 1
      test/libcxx/algorithms/version.pass.cpp
  9. 3 1
      test/libcxx/atomics/atomics.align/align.pass.sh.cpp
  10. 3 1
      test/libcxx/atomics/atomics.flag/init_bool.pass.cpp
  11. 3 1
      test/libcxx/atomics/diagnose_invalid_memory_order.fail.cpp
  12. 3 1
      test/libcxx/atomics/libcpp-has-no-threads.fail.cpp
  13. 3 1
      test/libcxx/atomics/libcpp-has-no-threads.pass.cpp
  14. 3 1
      test/libcxx/atomics/version.pass.cpp
  15. 3 1
      test/libcxx/containers/associative/map/version.pass.cpp
  16. 3 1
      test/libcxx/containers/associative/non_const_comparator.fail.cpp
  17. 3 1
      test/libcxx/containers/associative/set/version.pass.cpp
  18. 3 1
      test/libcxx/containers/associative/tree_balance_after_insert.pass.cpp
  19. 3 1
      test/libcxx/containers/associative/tree_key_value_traits.pass.cpp
  20. 3 1
      test/libcxx/containers/associative/tree_left_rotate.pass.cpp
  21. 3 1
      test/libcxx/containers/associative/tree_remove.pass.cpp
  22. 3 1
      test/libcxx/containers/associative/tree_right_rotate.pass.cpp
  23. 3 1
      test/libcxx/containers/associative/undef_min_max.pass.cpp
  24. 3 1
      test/libcxx/containers/container.adaptors/queue/version.pass.cpp
  25. 3 1
      test/libcxx/containers/container.adaptors/stack/version.pass.cpp
  26. 3 1
      test/libcxx/containers/gnu_cxx/hash_map.pass.cpp
  27. 3 1
      test/libcxx/containers/gnu_cxx/hash_set.pass.cpp
  28. 3 1
      test/libcxx/containers/sequences/array/array.zero/db_back.pass.cpp
  29. 3 1
      test/libcxx/containers/sequences/array/array.zero/db_front.pass.cpp
  30. 3 1
      test/libcxx/containers/sequences/array/array.zero/db_indexing.pass.cpp
  31. 3 1
      test/libcxx/containers/sequences/array/version.pass.cpp
  32. 3 1
      test/libcxx/containers/sequences/deque/incomplete.pass.cpp
  33. 3 1
      test/libcxx/containers/sequences/deque/pop_back_empty.pass.cpp
  34. 3 1
      test/libcxx/containers/sequences/deque/version.pass.cpp
  35. 3 1
      test/libcxx/containers/sequences/forwardlist/version.pass.cpp
  36. 3 1
      test/libcxx/containers/sequences/list/list.cons/db_copy.pass.cpp
  37. 3 1
      test/libcxx/containers/sequences/list/list.cons/db_move.pass.cpp
  38. 3 1
      test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp
  39. 3 1
      test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp
  40. 3 1
      test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp
  41. 3 1
      test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp
  42. 3 1
      test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp
  43. 3 1
      test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp
  44. 3 1
      test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp
  45. 3 1
      test/libcxx/containers/sequences/list/list.modifiers/insert_iter_iter_iter_db1.pass.cpp
  46. 3 1
      test/libcxx/containers/sequences/list/list.modifiers/insert_iter_rvalue_db1.pass.cpp
  47. 3 1
      test/libcxx/containers/sequences/list/list.modifiers/insert_iter_size_value_db1.pass.cpp
  48. 3 1
      test/libcxx/containers/sequences/list/list.modifiers/insert_iter_value_db1.pass.cpp
  49. 3 1
      test/libcxx/containers/sequences/list/list.modifiers/pop_back_db1.pass.cpp
  50. 3 1
      test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list.pass.cpp
  51. 3 1
      test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter.pass.cpp
  52. 3 1
      test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter_iter.pass.cpp
  53. 3 1
      test/libcxx/containers/sequences/list/version.pass.cpp
  54. 2 2
      test/libcxx/containers/sequences/vector/asan.pass.cpp
  55. 3 1
      test/libcxx/containers/sequences/vector/asan_throw.pass.cpp
  56. 3 1
      test/libcxx/containers/sequences/vector/const_value_type.pass.cpp
  57. 4 2
      test/libcxx/containers/sequences/vector/db_back.pass.cpp
  58. 4 2
      test/libcxx/containers/sequences/vector/db_cback.pass.cpp
  59. 4 2
      test/libcxx/containers/sequences/vector/db_cfront.pass.cpp
  60. 4 2
      test/libcxx/containers/sequences/vector/db_cindex.pass.cpp
  61. 4 2
      test/libcxx/containers/sequences/vector/db_front.pass.cpp
  62. 4 2
      test/libcxx/containers/sequences/vector/db_index.pass.cpp
  63. 4 2
      test/libcxx/containers/sequences/vector/db_iterators_2.pass.cpp
  64. 4 2
      test/libcxx/containers/sequences/vector/db_iterators_3.pass.cpp
  65. 4 2
      test/libcxx/containers/sequences/vector/db_iterators_4.pass.cpp
  66. 4 2
      test/libcxx/containers/sequences/vector/db_iterators_5.pass.cpp
  67. 4 2
      test/libcxx/containers/sequences/vector/db_iterators_6.pass.cpp
  68. 4 2
      test/libcxx/containers/sequences/vector/db_iterators_7.pass.cpp
  69. 4 2
      test/libcxx/containers/sequences/vector/db_iterators_8.pass.cpp
  70. 3 1
      test/libcxx/containers/sequences/vector/pop_back_empty.pass.cpp
  71. 3 1
      test/libcxx/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
  72. 3 1
      test/libcxx/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp
  73. 3 1
      test/libcxx/containers/sequences/vector/version.pass.cpp
  74. 3 1
      test/libcxx/containers/unord/key_value_traits.pass.cpp
  75. 1 1
      test/libcxx/containers/unord/next_pow2.pass.cpp
  76. 3 1
      test/libcxx/containers/unord/next_prime.pass.cpp
  77. 3 1
      test/libcxx/containers/unord/non_const_comparator.fail.cpp
  78. 4 2
      test/libcxx/containers/unord/unord.map/db_iterators_7.pass.cpp
  79. 4 2
      test/libcxx/containers/unord/unord.map/db_iterators_8.pass.cpp
  80. 4 2
      test/libcxx/containers/unord/unord.map/db_local_iterators_7.pass.cpp
  81. 4 2
      test/libcxx/containers/unord/unord.map/db_local_iterators_8.pass.cpp
  82. 3 1
      test/libcxx/containers/unord/unord.map/version.pass.cpp
  83. 3 1
      test/libcxx/containers/unord/unord.set/missing_hash_specialization.fail.cpp
  84. 3 1
      test/libcxx/containers/unord/unord.set/version.pass.cpp
  85. 3 1
      test/libcxx/debug/containers/db_associative_container_tests.pass.cpp
  86. 3 1
      test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
  87. 3 1
      test/libcxx/debug/containers/db_string.pass.cpp
  88. 3 1
      test/libcxx/debug/containers/db_unord_container_tests.pass.cpp
  89. 1 1
      test/libcxx/debug/debug_abort.pass.cpp
  90. 3 1
      test/libcxx/debug/debug_throw.pass.cpp
  91. 3 1
      test/libcxx/debug/debug_throw_register.pass.cpp
  92. 3 1
      test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.cxx1z.pass.cpp
  93. 3 1
      test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.fail.cpp
  94. 3 1
      test/libcxx/depr/depr.c.headers/ciso646.pass.cpp
  95. 3 1
      test/libcxx/depr/depr.c.headers/complex.h.pass.cpp
  96. 3 1
      test/libcxx/depr/depr.c.headers/extern_c.pass.cpp
  97. 3 1
      test/libcxx/depr/depr.c.headers/locale_h.pass.cpp
  98. 3 1
      test/libcxx/depr/depr.c.headers/tgmath_h.pass.cpp
  99. 3 1
      test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.fail.cpp
  100. 3 1
      test/libcxx/depr/depr.function.objects/depr.adaptors.cxx1z.pass.cpp

+ 1 - 1
cmake/Modules/CheckLibcxxAtomic.cmake

@@ -24,7 +24,7 @@ function(check_cxx_atomics varname)
 #include <atomic>
 std::atomic<uintptr_t> x;
 std::atomic<uintmax_t> y;
-int main() {
+int main(int, char**) {
   return x + y;
 }
 " ${varname})

+ 1 - 1
docs/DesignDocs/DebugMode.rst

@@ -53,7 +53,7 @@ assertion handler as follows:
 
   #define _LIBCPP_DEBUG 1
   #include <string>
-  int main() {
+  int main(int, char**) {
     std::__libcpp_debug_function = std::__libcpp_throw_debug_function;
     try {
       std::string::iterator bad_it;

+ 2 - 1
docs/DesignDocs/FileTimeType.rst

@@ -119,7 +119,7 @@ to throw in cases where the user was confident the call should succeed. (See bel
     set_file_times("/tmp/foo", new_times); // OK, supported by most FSes
   }
 
-  int main() {
+  int main(int, char**) {
     path p = "/tmp/foo";
     file_status st = status(p);
     if (!exists(st) || !is_regular_file(st))
@@ -128,6 +128,7 @@ to throw in cases where the user was confident the call should succeed. (See bel
       return 1;
     // It seems reasonable to assume this call should succeed.
     file_time_type tp = last_write_time(p); // BAD! Throws value_too_large.
+    return 0;
   }
 
 

+ 3 - 1
test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.cxx1z.pass.cpp

@@ -39,10 +39,12 @@ struct gen
 };
 
 
-int main()
+int main(int, char**)
 {
     std::vector<int> v;
     std::random_shuffle(v.begin(), v.end());
     gen r;
     std::random_shuffle(v.begin(), v.end(), r);
+
+  return 0;
 }

+ 3 - 1
test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.fail.cpp

@@ -40,10 +40,12 @@ struct gen
 };
 
 
-int main()
+int main(int, char**)
 {
     int v[1] = {1};
     std::random_shuffle(&v[0], &v[1]); // expected-error{{'random_shuffle<int *>' is deprecated}}
     gen r;
     std::random_shuffle(&v[0], &v[1], r); // expected-error{{'random_shuffle<int *, gen &>' is deprecated}}
+
+  return 0;
 }

+ 3 - 1
test/libcxx/algorithms/debug_less.pass.cpp

@@ -210,8 +210,10 @@ void test_upper_and_lower_bound() {
     }
 }
 
-int main() {
+int main(int, char**) {
     test_passing();
     test_failing();
     test_upper_and_lower_bound();
+
+  return 0;
 }

+ 3 - 1
test/libcxx/algorithms/half_positive.pass.cpp

@@ -28,7 +28,7 @@ TEST_CONSTEXPR bool test(IntType max_v = IntType(std::numeric_limits<UnderlyingT
 
 }  // namespace
 
-int main()
+int main(int, char**)
 {
     {
         assert(test<char>());
@@ -52,4 +52,6 @@ int main()
 #endif  // !defined(_LIBCPP_HAS_NO_INT128)
     }
 #endif // TEST_STD_VER >= 11
+
+  return 0;
 }

+ 3 - 1
test/libcxx/algorithms/version.pass.cpp

@@ -14,6 +14,8 @@
 #error _LIBCPP_VERSION not defined
 #endif
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }

+ 3 - 1
test/libcxx/atomics/atomics.align/align.pass.sh.cpp

@@ -35,7 +35,7 @@ template <typename T> struct atomic_test : public std::__atomic_base<T> {
   }
 };
 
-int main() {
+int main(int, char**) {
 
 // structs and unions can't be defined in the template invocation.
 // Work around this with a typedef.
@@ -89,4 +89,6 @@ int main() {
   CHECK_ALIGNMENT(struct LLIArr16 { long long int i[16]; });
   CHECK_ALIGNMENT(struct Padding { char c; /* padding */ long long int i; });
   CHECK_ALIGNMENT(union IntFloat { int i; float f; });
+
+  return 0;
 }

+ 3 - 1
test/libcxx/atomics/atomics.flag/init_bool.pass.cpp

@@ -27,7 +27,7 @@ X x;
 std::atomic_flag global = ATOMIC_FLAG_INIT;
 #endif
 
-int main()
+int main(int, char**)
 {
 #if TEST_STD_VER >= 11
     assert(global.test_and_set() == 1);
@@ -40,4 +40,6 @@ int main()
         std::atomic_flag f(true);
         assert(f.test_and_set() == 1);
     }
+
+  return 0;
 }

+ 3 - 1
test/libcxx/atomics/diagnose_invalid_memory_order.fail.cpp

@@ -19,7 +19,7 @@
 
 #include <atomic>
 
-int main() {
+int main(int, char**) {
     std::atomic<int> x(42);
     volatile std::atomic<int>& vx = x;
     int val1 = 1; ((void)val1);
@@ -124,4 +124,6 @@ int main() {
         std::atomic_compare_exchange_strong_explicit(&x, &val1, val2, std::memory_order_seq_cst, std::memory_order_acquire);
         std::atomic_compare_exchange_strong_explicit(&x, &val1, val2, std::memory_order_seq_cst, std::memory_order_seq_cst);
     }
+
+  return 0;
 }

+ 3 - 1
test/libcxx/atomics/libcpp-has-no-threads.fail.cpp

@@ -18,6 +18,8 @@
 
 #include <atomic>
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }

+ 3 - 1
test/libcxx/atomics/libcpp-has-no-threads.pass.cpp

@@ -12,6 +12,8 @@
    'libcpp-has-no-threads' is available iff _LIBCPP_HAS_NO_THREADS is defined
 #endif
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }

+ 3 - 1
test/libcxx/atomics/version.pass.cpp

@@ -16,6 +16,8 @@
 #error _LIBCPP_VERSION not defined
 #endif
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/associative/map/version.pass.cpp

@@ -14,6 +14,8 @@
 #error _LIBCPP_VERSION not defined
 #endif
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/associative/non_const_comparator.fail.cpp

@@ -22,7 +22,7 @@ struct BadCompare {
   }
 };
 
-int main() {
+int main(int, char**) {
   static_assert(!std::__invokable<BadCompare const&, int const&, int const&>::value, "");
   static_assert(std::__invokable<BadCompare&, int const&, int const&>::value, "");
 
@@ -44,4 +44,6 @@ int main() {
     using C = std::multimap<long, int, BadCompare>;
     C s;
   }
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/associative/set/version.pass.cpp

@@ -14,6 +14,8 @@
 #error _LIBCPP_VERSION not defined
 #endif
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/associative/tree_balance_after_insert.pass.cpp

@@ -1608,11 +1608,13 @@ test5()
     assert(h.__is_black_ == true);
 }
 
-int main()
+int main(int, char**)
 {
     test1();
     test2();
     test3();
     test4();
     test5();
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/associative/tree_key_value_traits.pass.cpp

@@ -53,6 +53,8 @@ void testKeyValueTrait() {
   }
 }
 
-int main() {
+int main(int, char**) {
   testKeyValueTrait();
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/associative/tree_left_rotate.pass.cpp

@@ -93,8 +93,10 @@ test2()
     assert(c.__right_ == 0);
 }
 
-int main()
+int main(int, char**)
 {
     test1();
     test2();
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/associative/tree_remove.pass.cpp

@@ -1641,10 +1641,12 @@ test4()
     assert(root.__is_black_ == false);
 }
 
-int main()
+int main(int, char**)
 {
     test1();
     test2();
     test3();
     test4();
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/associative/tree_right_rotate.pass.cpp

@@ -93,8 +93,10 @@ test2()
     assert(c.__right_ == 0);
 }
 
-int main()
+int main(int, char**)
 {
     test1();
     test2();
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/associative/undef_min_max.pass.cpp

@@ -15,7 +15,9 @@
 
 #include <map>
 
-int main() {
+int main(int, char**) {
   std::map<int, int> m;
   ((void)m);
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/container.adaptors/queue/version.pass.cpp

@@ -14,6 +14,8 @@
 #error _LIBCPP_VERSION not defined
 #endif
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/container.adaptors/stack/version.pass.cpp

@@ -14,6 +14,8 @@
 #error _LIBCPP_VERSION not defined
 #endif
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/gnu_cxx/hash_map.pass.cpp

@@ -17,9 +17,11 @@ namespace __gnu_cxx {
 template class hash_map<int, int>;
 }
 
-int main() {
+int main(int, char**) {
   typedef __gnu_cxx::hash_map<int, int> Map;
   Map m;
   Map m2(m);
   ((void)m2);
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/gnu_cxx/hash_set.pass.cpp

@@ -17,9 +17,11 @@ namespace __gnu_cxx {
 template class hash_set<int>;
 }
 
-int main() {
+int main(int, char**) {
   typedef __gnu_cxx::hash_set<int> Set;
   Set s;
   Set s2(s);
   ((void)s2);
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/array/array.zero/db_back.pass.cpp

@@ -29,7 +29,7 @@ inline bool CheckDebugThrows(Array& Arr) {
   return false;
 }
 
-int main()
+int main(int, char**)
 {
   {
     typedef std::array<int, 0> C;
@@ -45,4 +45,6 @@ int main()
     assert(CheckDebugThrows(c));
     assert(CheckDebugThrows(cc));
   }
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/array/array.zero/db_front.pass.cpp

@@ -29,7 +29,7 @@ inline bool CheckDebugThrows(Array& Arr) {
   return false;
 }
 
-int main()
+int main(int, char**)
 {
   {
     typedef std::array<int, 0> C;
@@ -45,4 +45,6 @@ int main()
     assert(CheckDebugThrows(c));
     assert(CheckDebugThrows(cc));
   }
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/array/array.zero/db_indexing.pass.cpp

@@ -29,7 +29,7 @@ inline bool CheckDebugThrows(Array& Arr, size_t Index) {
   return false;
 }
 
-int main()
+int main(int, char**)
 {
   {
     typedef std::array<int, 0> C;
@@ -49,4 +49,6 @@ int main()
     assert(CheckDebugThrows(cc, 0));
     assert(CheckDebugThrows(cc, 1));
   }
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/array/version.pass.cpp

@@ -14,6 +14,8 @@
 #error _LIBCPP_VERSION not defined
 #endif
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/deque/incomplete.pass.cpp

@@ -22,10 +22,12 @@ struct A {
   std::deque<A>::reverse_iterator it2;
 };
 
-int main()
+int main(int, char**)
 {
   A a;
   assert(a.d.size() == 0);
   a.it = a.d.begin();
   a.it2 = a.d.rend();
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/deque/pop_back_empty.pass.cpp

@@ -16,10 +16,12 @@
 #include <deque>
 
 
-int main() {
+int main(int, char**) {
     std::deque<int> q;
     q.push_back(0);
     q.pop_back();
     q.pop_back();
     std::exit(1);
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/deque/version.pass.cpp

@@ -14,6 +14,8 @@
 #error _LIBCPP_VERSION not defined
 #endif
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/forwardlist/version.pass.cpp

@@ -14,6 +14,8 @@
 #error _LIBCPP_VERSION not defined
 #endif
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/list/list.cons/db_copy.pass.cpp

@@ -19,7 +19,7 @@
 #include <cstdlib>
 #include <cassert>
 
-int main()
+int main(int, char**)
 {
     std::list<int> l1;
     l1.push_back(1); l1.push_back(2); l1.push_back(3);
@@ -27,4 +27,6 @@ int main()
     std::list<int> l2 = l1;
     l2.erase(i);
     assert(false);
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/list/list.cons/db_move.pass.cpp

@@ -25,10 +25,12 @@
 #include "test_allocator.h"
 #include "min_allocator.h"
 
-int main()
+int main(int, char**)
 {
     std::list<int> l1 = {1, 2, 3};
     std::list<int>::iterator i = l1.begin();
     std::list<int> l2 = std::move(l1);
     assert(*l2.erase(i) == 2);
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp

@@ -37,10 +37,12 @@ public:
     double getd() const {return d_;}
 };
 
-int main()
+int main(int, char**)
 {
     std::list<A> c1;
     std::list<A> c2;
     std::list<A>::iterator i = c1.emplace(c2.cbegin(), 2, 3.5);
     assert(false);
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp

@@ -20,11 +20,13 @@
 #include <cassert>
 #include <cstdlib>
 
-int main()
+int main(int, char**)
 {
     int a1[] = {1, 2, 3};
     std::list<int> l1(a1, a1+3);
     std::list<int>::const_iterator i = l1.end();
     l1.erase(i);
     assert(false);
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp

@@ -20,7 +20,7 @@
 #include <cassert>
 #include <cstdlib>
 
-int main()
+int main(int, char**)
 {
     int a1[] = {1, 2, 3};
     std::list<int> l1(a1, a1+3);
@@ -28,4 +28,6 @@ int main()
     std::list<int>::const_iterator i = l2.begin();
     l1.erase(i);
     assert(false);
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp

@@ -20,12 +20,14 @@
 #include <cassert>
 #include <cstdlib>
 
-int main()
+int main(int, char**)
 {
     int a1[] = {1, 2, 3};
     std::list<int> l1(a1, a1+3);
     std::list<int> l2(a1, a1+3);
     std::list<int>::iterator i = l1.erase(l2.cbegin(), next(l1.cbegin()));
     assert(false);
+
+  return 0;
 }
 

+ 3 - 1
test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp

@@ -20,11 +20,13 @@
 #include <cassert>
 #include <cstdlib>
 
-int main()
+int main(int, char**)
 {
     int a1[] = {1, 2, 3};
     std::list<int> l1(a1, a1+3);
     std::list<int> l2(a1, a1+3);
     std::list<int>::iterator i = l1.erase(l1.cbegin(), next(l2.cbegin()));
     assert(false);
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp

@@ -20,11 +20,13 @@
 #include <cassert>
 #include <cstdlib>
 
-int main()
+int main(int, char**)
 {
     int a1[] = {1, 2, 3};
     std::list<int> l1(a1, a1+3);
     std::list<int> l2(a1, a1+3);
     std::list<int>::iterator i = l1.erase(l2.cbegin(), next(l2.cbegin()));
     assert(false);
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp

@@ -20,10 +20,12 @@
 #include <cassert>
 #include <cstdlib>
 
-int main()
+int main(int, char**)
 {
     int a1[] = {1, 2, 3};
     std::list<int> l1(a1, a1+3);
     std::list<int>::iterator i = l1.erase(next(l1.cbegin()), l1.cbegin());
     assert(false);
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/list/list.modifiers/insert_iter_iter_iter_db1.pass.cpp

@@ -23,7 +23,7 @@
 #include <cassert>
 #include "test_iterators.h"
 
-int main()
+int main(int, char**)
 {
     {
         std::list<int> v(100);
@@ -35,4 +35,6 @@ int main()
                                        input_iterator<const int*>(a+N));
         assert(false);
     }
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/list/list.modifiers/insert_iter_rvalue_db1.pass.cpp

@@ -20,10 +20,12 @@
 #include <cstdlib>
 #include <cassert>
 
-int main()
+int main(int, char**)
 {
     std::list<int> v1(3);
     std::list<int> v2(3);
     v1.insert(v2.begin(), 4);
     assert(false);
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/list/list.modifiers/insert_iter_size_value_db1.pass.cpp

@@ -20,10 +20,12 @@
 #include <cstdlib>
 #include <cassert>
 
-int main()
+int main(int, char**)
 {
     std::list<int> c1(100);
     std::list<int> c2;
     std::list<int>::iterator i = c1.insert(next(c2.cbegin(), 10), 5, 1);
     assert(false);
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/list/list.modifiers/insert_iter_value_db1.pass.cpp

@@ -21,11 +21,13 @@
 #include <cassert>
 
 
-int main()
+int main(int, char**)
 {
     std::list<int> v1(3);
     std::list<int> v2(3);
     int i = 4;
     v1.insert(v2.begin(), i);
     assert(false);
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/list/list.modifiers/pop_back_db1.pass.cpp

@@ -20,7 +20,7 @@
 #include <cstdlib>
 #include <cassert>
 
-int main()
+int main(int, char**)
 {
     int a[] = {1, 2, 3};
     std::list<int> c(a, a+3);
@@ -32,4 +32,6 @@ int main()
     assert(c.empty());
     c.pop_back(); // operation under test
     assert(false);
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list.pass.cpp

@@ -20,7 +20,7 @@
 #include <cstdlib>
 #include <cassert>
 
-int main()
+int main(int, char**)
 {
     {
         std::list<int> v1(3);
@@ -28,4 +28,6 @@ int main()
         v1.splice(v2.begin(), v2);
         assert(false);
     }
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter.pass.cpp

@@ -20,7 +20,7 @@
 #include <cstdlib>
 #include <cassert>
 
-int main()
+int main(int, char**)
 {
     {
         std::list<int> v1(3);
@@ -28,4 +28,6 @@ int main()
         v1.splice(v1.begin(), v2, v1.begin());
         assert(false);
     }
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter_iter.pass.cpp

@@ -20,7 +20,7 @@
 #include <cstdlib>
 #include <cassert>
 
-int main()
+int main(int, char**)
 {
     {
         std::list<int> v1(3);
@@ -28,4 +28,6 @@ int main()
         v1.splice(v1.begin(), v2, v2.begin(), v1.end());
         assert(false);
     }
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/list/version.pass.cpp

@@ -14,6 +14,8 @@
 #error _LIBCPP_VERSION not defined
 #endif
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }

+ 2 - 2
test/libcxx/containers/sequences/vector/asan.pass.cpp

@@ -28,7 +28,7 @@ void do_exit() {
   exit(0);
 }
 
-int main()
+int main(int, char**)
 {
 #if TEST_STD_VER >= 11
     {
@@ -68,5 +68,5 @@ int main()
     }
 }
 #else
-int main () { return 0; }
+int main(int, char**) { return 0; }
 #endif

+ 3 - 1
test/libcxx/containers/sequences/vector/asan_throw.pass.cpp

@@ -219,7 +219,7 @@ void test_resize_param() {
   assert(is_contiguous_container_asan_correct(v));
 }
 
-int main() {
+int main(int, char**) {
   test_push_back();
   test_emplace_back();
   test_insert_range();
@@ -230,4 +230,6 @@ int main() {
   test_insert_n2();
   test_resize();
   test_resize_param();
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/vector/const_value_type.pass.cpp

@@ -15,7 +15,9 @@
 #include <vector>
 #include <type_traits>
 
-int main()
+int main(int, char**)
 {
     std::vector<const int> v = {1, 2, 3};
+
+  return 0;
 }

+ 4 - 2
test/libcxx/containers/sequences/vector/db_back.pass.cpp

@@ -23,7 +23,7 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-int main()
+int main(int, char**)
 {
     {
     typedef int T;
@@ -49,8 +49,10 @@ int main()
 
 #else
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }
 
 #endif

+ 4 - 2
test/libcxx/containers/sequences/vector/db_cback.pass.cpp

@@ -23,7 +23,7 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-int main()
+int main(int, char**)
 {
     {
     typedef int T;
@@ -45,8 +45,10 @@ int main()
 
 #else
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }
 
 #endif

+ 4 - 2
test/libcxx/containers/sequences/vector/db_cfront.pass.cpp

@@ -23,7 +23,7 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-int main()
+int main(int, char**)
 {
     {
     typedef int T;
@@ -45,8 +45,10 @@ int main()
 
 #else
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }
 
 #endif

+ 4 - 2
test/libcxx/containers/sequences/vector/db_cindex.pass.cpp

@@ -23,7 +23,7 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-int main()
+int main(int, char**)
 {
     {
     typedef int T;
@@ -47,8 +47,10 @@ int main()
 
 #else
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }
 
 #endif

+ 4 - 2
test/libcxx/containers/sequences/vector/db_front.pass.cpp

@@ -23,7 +23,7 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-int main()
+int main(int, char**)
 {
     {
     typedef int T;
@@ -49,8 +49,10 @@ int main()
 
 #else
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }
 
 #endif

+ 4 - 2
test/libcxx/containers/sequences/vector/db_index.pass.cpp

@@ -23,7 +23,7 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-int main()
+int main(int, char**)
 {
     {
     typedef int T;
@@ -49,8 +49,10 @@ int main()
 
 #else
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }
 
 #endif

+ 4 - 2
test/libcxx/containers/sequences/vector/db_iterators_2.pass.cpp

@@ -23,7 +23,7 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-int main()
+int main(int, char**)
 {
     {
     typedef int T;
@@ -47,8 +47,10 @@ int main()
 
 #else
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }
 
 #endif

+ 4 - 2
test/libcxx/containers/sequences/vector/db_iterators_3.pass.cpp

@@ -23,7 +23,7 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-int main()
+int main(int, char**)
 {
     {
     typedef int T;
@@ -47,8 +47,10 @@ int main()
 
 #else
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }
 
 #endif

+ 4 - 2
test/libcxx/containers/sequences/vector/db_iterators_4.pass.cpp

@@ -23,7 +23,7 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-int main()
+int main(int, char**)
 {
     {
     typedef int T;
@@ -49,8 +49,10 @@ int main()
 
 #else
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }
 
 #endif

+ 4 - 2
test/libcxx/containers/sequences/vector/db_iterators_5.pass.cpp

@@ -23,7 +23,7 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-int main()
+int main(int, char**)
 {
     {
     typedef int T;
@@ -53,8 +53,10 @@ int main()
 
 #else
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }
 
 #endif

+ 4 - 2
test/libcxx/containers/sequences/vector/db_iterators_6.pass.cpp

@@ -23,7 +23,7 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-int main()
+int main(int, char**)
 {
     {
     typedef int T;
@@ -51,8 +51,10 @@ int main()
 
 #else
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }
 
 #endif

+ 4 - 2
test/libcxx/containers/sequences/vector/db_iterators_7.pass.cpp

@@ -23,7 +23,7 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-int main()
+int main(int, char**)
 {
     {
     typedef int T;
@@ -51,8 +51,10 @@ int main()
 
 #else
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }
 
 #endif

+ 4 - 2
test/libcxx/containers/sequences/vector/db_iterators_8.pass.cpp

@@ -23,7 +23,7 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-int main()
+int main(int, char**)
 {
     {
     typedef int T;
@@ -47,8 +47,10 @@ int main()
 
 #else
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }
 
 #endif

+ 3 - 1
test/libcxx/containers/sequences/vector/pop_back_empty.pass.cpp

@@ -16,10 +16,12 @@
 #include <vector>
 
 
-int main() {
+int main(int, char**) {
     std::vector<int> v;
     v.push_back(0);
     v.pop_back();
     v.pop_back();
     std::exit(1);
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp

@@ -48,6 +48,8 @@ void test_ctor_under_alloc() {
   }
 }
 
-int main() {
+int main(int, char**) {
   test_ctor_under_alloc();
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp

@@ -51,6 +51,8 @@ void test_ctor_under_alloc() {
   }
 }
 
-int main() {
+int main(int, char**) {
   test_ctor_under_alloc();
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/sequences/vector/version.pass.cpp

@@ -14,6 +14,8 @@
 #error _LIBCPP_VERSION not defined
 #endif
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/unord/key_value_traits.pass.cpp

@@ -53,6 +53,8 @@ void testKeyValueTrait() {
   }
 }
 
-int main() {
+int main(int, char**) {
   testKeyValueTrait();
+
+  return 0;
 }

+ 1 - 1
test/libcxx/containers/unord/next_pow2.pass.cpp

@@ -74,7 +74,7 @@ fuzz_unordered_map_reserve(unsigned num_inserts,
     assert(m.bucket_count() >= num_reserve2);
 }
 
-int main()
+int main(int, char**)
 {
     test_next_pow2();
 

+ 3 - 1
test/libcxx/containers/unord/next_prime.pass.cpp

@@ -36,7 +36,7 @@ is_prime(size_t n)
     return true;
 }
 
-int main()
+int main(int, char**)
 {
     assert(std::__next_prime(0) == 0);
     for (std::size_t n = 1; n <= 100000; ++n)
@@ -47,4 +47,6 @@ int main()
             assert(!is_prime(i));
         assert(is_prime(p));
     }
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/unord/non_const_comparator.fail.cpp

@@ -29,7 +29,7 @@ struct BadEqual {
   }
 };
 
-int main() {
+int main(int, char**) {
   static_assert(!std::__invokable<BadEqual const&, int const&, int const&>::value, "");
   static_assert(std::__invokable<BadEqual&, int const&, int const&>::value, "");
 
@@ -54,4 +54,6 @@ int main() {
     using C = std::unordered_multimap<long, int, BadHash, BadEqual>;
     C s;
   }
+
+  return 0;
 }

+ 4 - 2
test/libcxx/containers/unord/unord.map/db_iterators_7.pass.cpp

@@ -24,7 +24,7 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-int main()
+int main(int, char**)
 {
     {
     typedef std::unordered_map<int, std::string> C;
@@ -53,8 +53,10 @@ int main()
 
 #else
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }
 
 #endif

+ 4 - 2
test/libcxx/containers/unord/unord.map/db_iterators_8.pass.cpp

@@ -24,7 +24,7 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-int main()
+int main(int, char**)
 {
     {
     typedef std::unordered_map<int, std::string> C;
@@ -49,8 +49,10 @@ int main()
 
 #else
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }
 
 #endif

+ 4 - 2
test/libcxx/containers/unord/unord.map/db_local_iterators_7.pass.cpp

@@ -24,7 +24,7 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-int main()
+int main(int, char**)
 {
     {
     typedef std::unordered_map<int, std::string> C;
@@ -50,8 +50,10 @@ int main()
 
 #else
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }
 
 #endif

+ 4 - 2
test/libcxx/containers/unord/unord.map/db_local_iterators_8.pass.cpp

@@ -24,7 +24,7 @@
 #include "test_macros.h"
 #include "min_allocator.h"
 
-int main()
+int main(int, char**)
 {
     {
     typedef std::unordered_map<int, std::string> C;
@@ -47,8 +47,10 @@ int main()
 
 #else
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }
 
 #endif

+ 3 - 1
test/libcxx/containers/unord/unord.map/version.pass.cpp

@@ -14,6 +14,8 @@
 #error _LIBCPP_VERSION not defined
 #endif
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/unord/unord.set/missing_hash_specialization.fail.cpp

@@ -42,7 +42,7 @@ struct GoodHashNoDefault {
   size_t operator()(T const&) const { return 0; }
 };
 
-int main() {
+int main(int, char**) {
 
   {
     using Set = std::unordered_set<VT>;
@@ -66,4 +66,6 @@ int main() {
     using Set = std::unordered_set<int, GoodHashNoDefault>;
     Set s(/*bucketcount*/42, GoodHashNoDefault(nullptr));
   }
+
+  return 0;
 }

+ 3 - 1
test/libcxx/containers/unord/unord.set/version.pass.cpp

@@ -14,6 +14,8 @@
 #error _LIBCPP_VERSION not defined
 #endif
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }

+ 3 - 1
test/libcxx/debug/containers/db_associative_container_tests.pass.cpp

@@ -51,7 +51,7 @@ private:
   // FIXME Add tests here
 };
 
-int main()
+int main(int, char**)
 {
   using SetAlloc = test_allocator<int>;
   using MapAlloc = test_allocator<std::pair<const int, int>>;
@@ -66,4 +66,6 @@ int main()
     AssociativeContainerChecks<
         std::multimap<int, int, std::less<int>, MapAlloc>, CT_MultiMap>::run();
   }
+
+  return 0;
 }

+ 3 - 1
test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp

@@ -307,7 +307,7 @@ private:
   }
 };
 
-int main()
+int main(int, char**)
 {
   using Alloc = test_allocator<int>;
   {
@@ -323,4 +323,6 @@ int main()
     SequenceContainerChecks<
         std::deque<int, Alloc>, CT_Deque>::run();
   }
+
+  return 0;
 }

+ 3 - 1
test/libcxx/debug/containers/db_string.pass.cpp

@@ -93,7 +93,9 @@ private:
   }
 };
 
-int main()
+int main(int, char**)
 {
   StringContainerChecks<>::run();
+
+  return 0;
 }

+ 3 - 1
test/libcxx/debug/containers/db_unord_container_tests.pass.cpp

@@ -49,7 +49,7 @@ private:
 
 };
 
-int main()
+int main(int, char**)
 {
   using SetAlloc = test_allocator<int>;
   using MapAlloc = test_allocator<std::pair<const int, int>>;
@@ -67,4 +67,6 @@ int main()
         std::unordered_multiset<int, std::hash<int>, std::equal_to<int>, SetAlloc>,
         CT_UnorderedMultiSet>::run();
   }
+
+  return 0;
 }

+ 1 - 1
test/libcxx/debug/debug_abort.pass.cpp

@@ -27,7 +27,7 @@ void signal_handler(int signal)
     std::_Exit(EXIT_FAILURE);
 }
 
-int main()
+int main(int, char**)
 {
   if (std::signal(SIGABRT, signal_handler) != SIG_ERR)
     _LIBCPP_ASSERT(false, "foo");

+ 3 - 1
test/libcxx/debug/debug_throw.pass.cpp

@@ -23,7 +23,7 @@
 #include <type_traits>
 #include <__debug>
 
-int main()
+int main(int, char**)
 {
   {
     std::__libcpp_debug_function = std::__libcpp_throw_debug_function;
@@ -37,4 +37,6 @@ int main()
                                   std::__libcpp_debug_exception
                   >::value), "must be an exception");
   }
+
+  return 0;
 }

+ 3 - 1
test/libcxx/debug/debug_throw_register.pass.cpp

@@ -26,10 +26,12 @@
 #include <__debug>
 #include <cassert>
 
-int main()
+int main(int, char**)
 {
   try {
     _LIBCPP_ASSERT(false, "foo");
     assert(false);
   } catch (...) {}
+
+  return 0;
 }

+ 3 - 1
test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.cxx1z.pass.cpp

@@ -22,7 +22,9 @@
 #include <memory>
 #include <type_traits>
 
-int main()
+int main(int, char**)
 {
     std::auto_ptr<int> p;
+
+  return 0;
 }

+ 3 - 1
test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.fail.cpp

@@ -30,9 +30,11 @@
 #include <memory>
 #include "test_macros.h"
 
-int main()
+int main(int, char**)
 {
     typedef std::auto_ptr<int> AP; // expected-error{{'auto_ptr<int>' is deprecated}}
     typedef std::auto_ptr<void> APV; // expected-error{{'auto_ptr<void>' is deprecated}}
     typedef std::auto_ptr_ref<int> APR; // expected-error{{'auto_ptr_ref<int>' is deprecated}}
+
+  return 0;
 }

+ 3 - 1
test/libcxx/depr/depr.c.headers/ciso646.pass.cpp

@@ -14,6 +14,8 @@
 #error _LIBCPP_VERSION not defined
 #endif
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }

+ 3 - 1
test/libcxx/depr/depr.c.headers/complex.h.pass.cpp

@@ -14,8 +14,10 @@
 #error _LIBCPP_VERSION not defined
 #endif
 
-int main()
+int main(int, char**)
 {
     std::complex<double> d;
     (void)d;
+
+  return 0;
 }

+ 3 - 1
test/libcxx/depr/depr.c.headers/extern_c.pass.cpp

@@ -39,4 +39,6 @@ extern "C" {
 #include <wctype.h>
 }
 
-int main() {}
+int main(int, char**) {
+  return 0;
+}

+ 3 - 1
test/libcxx/depr/depr.c.headers/locale_h.pass.cpp

@@ -14,6 +14,8 @@
 #error _LIBCPP_VERSION not defined
 #endif
 
-int main()
+int main(int, char**)
 {
+
+  return 0;
 }

+ 3 - 1
test/libcxx/depr/depr.c.headers/tgmath_h.pass.cpp

@@ -14,10 +14,12 @@
 #error _LIBCPP_VERSION not defined
 #endif
 
-int main()
+int main(int, char**)
 {
     std::complex<double> cd;
     (void)cd;
     double x = sin(1.0);
     (void)x; // to placate scan-build
+
+  return 0;
 }

+ 3 - 1
test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.fail.cpp

@@ -31,7 +31,7 @@ struct Foo {
     int identity(int v) { return v; }
 };
 
-int main()
+int main(int, char**)
 {
     typedef std::pointer_to_unary_function<int, int> PUF; // expected-error{{'pointer_to_unary_function<int, int>' is deprecated}}
     typedef std::pointer_to_binary_function<int, int, int> PBF; // expected-error{{'pointer_to_binary_function<int, int, int>' is deprecated}}
@@ -55,4 +55,6 @@ int main()
     std::mem_fun_ref<int, Foo, int>(&Foo::identity); // expected-error{{'mem_fun_ref<int, Foo, int>' is deprecated}}
     std::mem_fun_ref<int, Foo>(&Foo::const_zero); // expected-error{{'mem_fun_ref<int, Foo>' is deprecated}}
     std::mem_fun_ref<int, Foo, int>(&Foo::const_identity); // expected-error{{'mem_fun_ref<int, Foo, int>' is deprecated}}
+
+  return 0;
 }

+ 3 - 1
test/libcxx/depr/depr.function.objects/depr.adaptors.cxx1z.pass.cpp

@@ -30,7 +30,7 @@ struct Foo {
   int sum(int a, int b) const { return a + b; }
 };
 
-int main()
+int main(int, char**)
 {
     typedef std::pointer_to_unary_function<int, int> PUF;
     typedef std::pointer_to_binary_function<int, int, int> PBF;
@@ -60,4 +60,6 @@ int main()
 
     assert((std::mem_fun_ref(&Foo::zero)(f) == 0));
     assert((std::mem_fun_ref(&Foo::identity)(f, 5) == 5));
+
+  return 0;
 }

部分文件因为文件数量过多而无法显示