[libcxx-commits] [libcxx] 72f0edf - [libc++] Remove unnecessary main() function in .compile.pass.cpp and .verify.cpp tests

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 17 14:56:44 PDT 2023


Author: Louis Dionne
Date: 2023-03-17T17:56:21-04:00
New Revision: 72f0edf3f4291d2614719a8c8af21a7a62ed5d74

URL: https://github.com/llvm/llvm-project/commit/72f0edf3f4291d2614719a8c8af21a7a62ed5d74
DIFF: https://github.com/llvm/llvm-project/commit/72f0edf3f4291d2614719a8c8af21a7a62ed5d74.diff

LOG: [libc++] Remove unnecessary main() function in .compile.pass.cpp and .verify.cpp tests

We pretty consistently don't define those cause they are not needed,
and it removes the potential pitfall to think that these tests are
being run. This doesn't touch .compile.fail.cpp tests since those
should be replaced by .verify.cpp tests anyway, and there would be
a lot to fix up.

As a fly-by, I also fixed a bit of formatting, removed a few unused
includes and made some very minor, clearly NFC refactorings such as
in allocator.traits/allocator.traits.members/allocate.verify.cpp where
the old test basically made no sense the way it was written.

Differential Revision: https://reviews.llvm.org/D146236

Added: 
    

Modified: 
    libcxx/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.verify.cpp
    libcxx/test/libcxx/atomics/bit-int.verify.cpp
    libcxx/test/libcxx/atomics/diagnose_invalid_memory_order.verify.cpp
    libcxx/test/libcxx/containers/associative/non_const_comparator.incomplete.verify.cpp
    libcxx/test/libcxx/containers/associative/non_const_comparator.verify.cpp
    libcxx/test/libcxx/containers/unord/non_const_comparator.incomplete.verify.cpp
    libcxx/test/libcxx/containers/unord/non_const_comparator.verify.cpp
    libcxx/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.verify.cpp
    libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/address.depr_in_cxx17.verify.cpp
    libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.verify.cpp
    libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.depr_in_cxx17.verify.cpp
    libcxx/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.verify.cpp
    libcxx/test/libcxx/diagnostics/nodiscard_aftercxx17.verify.cpp
    libcxx/test/libcxx/diagnostics/nodiscard_extensions.compile.pass.cpp
    libcxx/test/libcxx/diagnostics/nodiscard_extensions.verify.cpp
    libcxx/test/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.cons/ctor.iter.explicit.verify.cpp
    libcxx/test/libcxx/iterators/predef.iterators/reverse.iterators/bad_template_argument.verify.cpp
    libcxx/test/libcxx/language.support/support.dynamic/aligned_alloc_availability.verify.cpp
    libcxx/test/libcxx/numerics/rand/rand.device/has-no-random-device.verify.cpp
    libcxx/test/libcxx/ranges/version.compile.pass.cpp
    libcxx/test/libcxx/selftest/verify.cpp/no-werror.verify.cpp
    libcxx/test/libcxx/thread/atomic.availability.verify.cpp
    libcxx/test/libcxx/thread/barrier.availability.verify.cpp
    libcxx/test/libcxx/thread/latch.availability.verify.cpp
    libcxx/test/libcxx/thread/semaphore.availability.verify.cpp
    libcxx/test/libcxx/thread/thread.barrier/version.compile.pass.cpp
    libcxx/test/libcxx/thread/thread.latch/version.compile.pass.cpp
    libcxx/test/libcxx/thread/thread.lock/thread.lock.guard/nodiscard.verify.cpp
    libcxx/test/libcxx/thread/thread.semaphore/version.compile.pass.cpp
    libcxx/test/libcxx/utilities/format/version.compile.pass.cpp
    libcxx/test/std/atomics/atomics.types.generic/standard_layout.compile.pass.cpp
    libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/copy.assign.ptr.volatile.verify.cpp
    libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/copy.assign.volatile.verify.cpp
    libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable.compile.pass.cpp
    libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable_with.compile.pass.cpp
    libcxx/test/std/concepts/concepts.lang/concept.common/common_with.compile.pass.cpp
    libcxx/test/std/concepts/concepts.lang/concept.commonref/common_reference.compile.pass.cpp
    libcxx/test/std/concepts/concepts.lang/concept.constructible/constructible_from.compile.pass.cpp
    libcxx/test/std/concepts/concepts.lang/concept.copyconstructible/copy_constructible.compile.pass.cpp
    libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
    libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.verify.cpp
    libcxx/test/std/concepts/concepts.lang/concept.destructible/destructible.compile.pass.cpp
    libcxx/test/std/concepts/concepts.lang/concept.moveconstructible/move_constructible.compile.pass.cpp
    libcxx/test/std/concepts/concepts.object/copyable.compile.pass.cpp
    libcxx/test/std/concepts/concepts.object/movable.compile.pass.cpp
    libcxx/test/std/concepts/concepts.object/regular.compile.pass.cpp
    libcxx/test/std/concepts/concepts.object/semiregular.compile.pass.cpp
    libcxx/test/std/containers/associative/map/map.access/empty.verify.cpp
    libcxx/test/std/containers/associative/multimap/empty.verify.cpp
    libcxx/test/std/containers/associative/multiset/empty.verify.cpp
    libcxx/test/std/containers/associative/set/empty.verify.cpp
    libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.members/empty.verify.cpp
    libcxx/test/std/containers/container.adaptors/queue/queue.defn/empty.verify.cpp
    libcxx/test/std/containers/container.adaptors/stack/stack.defn/empty.verify.cpp
    libcxx/test/std/containers/sequences/array/empty.verify.cpp
    libcxx/test/std/containers/sequences/deque/deque.capacity/empty.verify.cpp
    libcxx/test/std/containers/sequences/forwardlist/empty.verify.cpp
    libcxx/test/std/containers/sequences/list/list.capacity/empty.verify.cpp
    libcxx/test/std/containers/sequences/vector.bool/empty.verify.cpp
    libcxx/test/std/containers/sequences/vector/vector.capacity/empty.verify.cpp
    libcxx/test/std/containers/sequences/vector/vector.cons/copy.move_only.verify.cpp
    libcxx/test/std/containers/unord/unord.map/empty.verify.cpp
    libcxx/test/std/containers/unord/unord.multimap/empty.verify.cpp
    libcxx/test/std/containers/unord/unord.multiset/empty.verify.cpp
    libcxx/test/std/containers/unord/unord.set/empty.verify.cpp
    libcxx/test/std/containers/views/views.span/span.cons/iterator_len.verify.cpp
    libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.verify.cpp
    libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.verify.cpp
    libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.verify.cpp
    libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.verify.cpp
    libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.verify.cpp
    libcxx/test/std/input.output/filesystems/class.path/path.member/path.decompose/empty.verify.cpp
    libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_char.verify.cpp
    libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_traits.verify.cpp
    libcxx/test/std/iterators/iterator.container/empty.array.verify.cpp
    libcxx/test/std/iterators/iterator.container/empty.container.verify.cpp
    libcxx/test/std/iterators/iterator.container/empty.initializer_list.verify.cpp
    libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.move/iter_move.nodiscard.verify.cpp
    libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/ctor.iter.explicit.verify.cpp
    libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.ref/deprecated.verify.cpp
    libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.iter.explicit.verify.cpp
    libcxx/test/std/language.support/cmp/cmp.categories.pre/zero_type.verify.cpp
    libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.verify.cpp
    libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.verify.cpp
    libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.verify.cpp
    libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.verify.cpp
    libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.verify.cpp
    libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.verify.cpp
    libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size.verify.cpp
    libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.verify.cpp
    libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.verify.cpp
    libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_nothrow.verify.cpp
    libcxx/test/std/language.support/support.dynamic/ptr.launder/launder.nodiscard.verify.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char16_t_char.depr_in_cxx20.verify.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char32_t_char.depr_in_cxx20.verify.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char16_t_char.depr_in_cxx20.verify.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char32_t_char.depr_in_cxx20.verify.cpp
    libcxx/test/std/numerics/numbers/illformed.verify.cpp
    libcxx/test/std/numerics/rand/rand.req/rand.req.urng/uniform_random_bit_generator.compile.pass.cpp
    libcxx/test/std/re/re.results/re.results.size/empty.verify.cpp
    libcxx/test/std/strings/basic.string/string.capacity/empty.verify.cpp
    libcxx/test/std/strings/basic.string/string.capacity/reserve.deprecated_in_cxx20.verify.cpp
    libcxx/test/std/strings/string.view/string.view.capacity/empty.verify.cpp
    libcxx/test/std/thread/futures/futures.async/async.verify.cpp
    libcxx/test/std/thread/futures/futures.promise/copy_assign.verify.cpp
    libcxx/test/std/thread/futures/futures.promise/copy_ctor.verify.cpp
    libcxx/test/std/thread/futures/futures.unique_future/copy_assign.verify.cpp
    libcxx/test/std/thread/futures/futures.unique_future/copy_ctor.verify.cpp
    libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.verify.cpp
    libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.verify.cpp
    libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp
    libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp
    libcxx/test/std/utilities/format/format.arguments/format.args/types.compile.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.verify.cpp
    libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.verify.cpp
    libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/types.compile.pass.cpp
    libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.verify.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.verify.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.verify.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.verify.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.verify.cpp
    libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/deduct_F.verify.cpp
    libcxx/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.verify.cpp
    libcxx/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.verify.cpp
    libcxx/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.verify.cpp
    libcxx/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.verify.cpp
    libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.verify.cpp
    libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp
    libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.verify.cpp
    libcxx/test/std/utilities/memory/default.allocator/allocator_types.deprecated_in_cxx17.verify.cpp
    libcxx/test/std/utilities/memory/default.allocator/allocator_types.removed_in_cxx20.verify.cpp
    libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/common_reference.compile.pass.cpp
    libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.verify.cpp
    libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.verify.cpp
    libcxx/test/std/utilities/utility/utility.underlying/to_underlying.verify.cpp
    libcxx/test/support/test.support/test_macros_header.no_exceptions.verify.cpp
    libcxx/test/support/test.support/test_macros_header.no_rtti.verify.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.verify.cpp b/libcxx/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.verify.cpp
index fc58955c1c2c..057f126a93cf 100644
--- a/libcxx/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.verify.cpp
+++ b/libcxx/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.verify.cpp
@@ -35,12 +35,9 @@ struct gen
 };
 
 
-int main(int, char**)
-{
+void f() {
     int v[1] = {1};
     std::random_shuffle(&v[0], &v[1]); // expected-warning {{'random_shuffle<int *>' is deprecated}}
     gen r;
     std::random_shuffle(&v[0], &v[1], r); // expected-warning {{'random_shuffle<int *, gen &>' is deprecated}}
-
-  return 0;
 }

diff  --git a/libcxx/test/libcxx/atomics/bit-int.verify.cpp b/libcxx/test/libcxx/atomics/bit-int.verify.cpp
index 612688d43a90..209ec71d9e9c 100644
--- a/libcxx/test/libcxx/atomics/bit-int.verify.cpp
+++ b/libcxx/test/libcxx/atomics/bit-int.verify.cpp
@@ -18,10 +18,7 @@
 
 #include <atomic>
 
-int main(int, char**)
-{
+void f() {
   // expected-error@*:*1 {{_Atomic cannot be applied to integer type '_BitInt(32)'}}
   std::atomic<_BitInt(32)> x(42);
-
-  return 0;
 }

diff  --git a/libcxx/test/libcxx/atomics/diagnose_invalid_memory_order.verify.cpp b/libcxx/test/libcxx/atomics/diagnose_invalid_memory_order.verify.cpp
index 3eb4cab840da..a6c1160c7022 100644
--- a/libcxx/test/libcxx/atomics/diagnose_invalid_memory_order.verify.cpp
+++ b/libcxx/test/libcxx/atomics/diagnose_invalid_memory_order.verify.cpp
@@ -18,7 +18,7 @@
 
 #include <atomic>
 
-int main(int, char**) {
+void f() {
     std::atomic<int> x(42);
     volatile std::atomic<int>& vx = x;
     int val1 = 1; ((void)val1);
@@ -123,6 +123,4 @@ int main(int, char**) {
         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;
 }

diff  --git a/libcxx/test/libcxx/containers/associative/non_const_comparator.incomplete.verify.cpp b/libcxx/test/libcxx/containers/associative/non_const_comparator.incomplete.verify.cpp
index eb4d4cfc2043..3f7086f7e37f 100644
--- a/libcxx/test/libcxx/containers/associative/non_const_comparator.incomplete.verify.cpp
+++ b/libcxx/test/libcxx/containers/associative/non_const_comparator.incomplete.verify.cpp
@@ -17,9 +17,6 @@
 #include <map>
 #include <functional>
 
-#include "test_macros.h"
-
-
 template <template <typename ...> class Container>
 void test_set() {
   struct KeyBase { };
@@ -48,12 +45,10 @@ void test_map() {
   C c;
 }
 
-int main(int, char**) {
+void f() {
   // expected-no-diagnostics
   test_set<std::set>();
   test_set<std::multiset>();
   test_map<std::map>();
   test_map<std::multimap>();
-
-  return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/associative/non_const_comparator.verify.cpp b/libcxx/test/libcxx/containers/associative/non_const_comparator.verify.cpp
index 61cdc2f10bd9..3bb59f1920f6 100644
--- a/libcxx/test/libcxx/containers/associative/non_const_comparator.verify.cpp
+++ b/libcxx/test/libcxx/containers/associative/non_const_comparator.verify.cpp
@@ -23,7 +23,7 @@ struct BadCompare {
   }
 };
 
-int main(int, char**) {
+void f() {
   static_assert(!std::__invokable<BadCompare const&, int const&, int const&>::value, "");
   static_assert(std::__invokable<BadCompare&, int const&, int const&>::value, "");
 
@@ -45,6 +45,4 @@ int main(int, char**) {
     using C = std::multimap<long, int, BadCompare>;
     C s;
   }
-
-  return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/unord/non_const_comparator.incomplete.verify.cpp b/libcxx/test/libcxx/containers/unord/non_const_comparator.incomplete.verify.cpp
index 603b4fcb50ff..9fd4f698b5f9 100644
--- a/libcxx/test/libcxx/containers/unord/non_const_comparator.incomplete.verify.cpp
+++ b/libcxx/test/libcxx/containers/unord/non_const_comparator.incomplete.verify.cpp
@@ -48,12 +48,10 @@ void test_map() {
   C c;
 }
 
-int main(int, char**) {
+void f() {
   // expected-no-diagnostics
   test_set<std::unordered_set>();
   test_set<std::unordered_multiset>();
   test_map<std::unordered_map>();
   test_map<std::unordered_multimap>();
-
-  return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/unord/non_const_comparator.verify.cpp b/libcxx/test/libcxx/containers/unord/non_const_comparator.verify.cpp
index 2a389c0774c1..0452d080a712 100644
--- a/libcxx/test/libcxx/containers/unord/non_const_comparator.verify.cpp
+++ b/libcxx/test/libcxx/containers/unord/non_const_comparator.verify.cpp
@@ -29,7 +29,7 @@ struct BadEqual {
   }
 };
 
-int main(int, char**) {
+void f() {
   static_assert(!std::__invokable<BadEqual const&, int const&, int const&>::value, "");
   static_assert(std::__invokable<BadEqual&, int const&, int const&>::value, "");
 
@@ -54,6 +54,4 @@ int main(int, char**) {
     using C = std::unordered_multimap<long, int, BadHash, BadEqual>;
     C s;
   }
-
-  return 0;
 }

diff  --git a/libcxx/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.verify.cpp b/libcxx/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.verify.cpp
index 9fc83062c69a..3fe7ced3f1d8 100644
--- a/libcxx/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.verify.cpp
+++ b/libcxx/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.verify.cpp
@@ -25,11 +25,6 @@
 #include <memory>
 #include "test_macros.h"
 
-int main(int, char**)
-{
-    typedef std::auto_ptr<int> AP; // expected-warning {{'auto_ptr<int>' is deprecated}}
-    typedef std::auto_ptr<void> APV; // expected-warning {{'auto_ptr<void>' is deprecated}}
-    typedef std::auto_ptr_ref<int> APR; // expected-warning {{'auto_ptr_ref<int>' is deprecated}}
-
-  return 0;
-}
+typedef std::auto_ptr<int> AP; // expected-warning {{'auto_ptr<int>' is deprecated}}
+typedef std::auto_ptr<void> APV; // expected-warning {{'auto_ptr<void>' is deprecated}}
+typedef std::auto_ptr_ref<int> APR; // expected-warning {{'auto_ptr_ref<int>' is deprecated}}

diff  --git a/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/address.depr_in_cxx17.verify.cpp b/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/address.depr_in_cxx17.verify.cpp
index 4ccc3c099acd..5b21cc607711 100644
--- a/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/address.depr_in_cxx17.verify.cpp
+++ b/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/address.depr_in_cxx17.verify.cpp
@@ -19,15 +19,10 @@
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS
 
 #include <memory>
-#include "test_macros.h"
 
-int main(int, char**)
-{
+void f() {
   int x = 0;
   std::allocator<int> a;
 
-  int* p = a.address(x); // expected-warning {{'address' is deprecated}}
-  (void)p;
-
-  return 0;
+  (void)a.address(x); // expected-warning {{'address' is deprecated}}
 }

diff  --git a/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.verify.cpp b/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.verify.cpp
index c122be5996d0..2289cd6cd404 100644
--- a/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.verify.cpp
+++ b/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.verify.cpp
@@ -21,14 +21,8 @@
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
 
 #include <memory>
-#include <cassert>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     std::allocator<int> a;
     a.allocate(3, nullptr); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.depr_in_cxx17.verify.cpp b/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.depr_in_cxx17.verify.cpp
index efb57b6e496e..79fd61d24c4c 100644
--- a/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.depr_in_cxx17.verify.cpp
+++ b/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.depr_in_cxx17.verify.cpp
@@ -18,12 +18,10 @@
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS
 
 #include <memory>
+
 #include "test_macros.h"
 
-int main(int, char**)
-{
+void f() {
     std::allocator<int> a;
     TEST_IGNORE_NODISCARD a.allocate(3, nullptr); // expected-warning {{'allocate' is deprecated}}
-
-    return 0;
 }

diff  --git a/libcxx/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.verify.cpp b/libcxx/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.verify.cpp
index 2b3a05eaad74..87d81d00ebae 100644
--- a/libcxx/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.verify.cpp
+++ b/libcxx/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.verify.cpp
@@ -14,7 +14,6 @@
 
 #include <functional>
 #include <cassert>
-#include "test_macros.h"
 
 int identity(int v) { return v; }
 int sum(int a, int b) { return a + b; }
@@ -26,8 +25,7 @@ struct Foo {
     int identity(int v) { return v; }
 };
 
-int main(int, char**)
-{
+void f() {
     typedef std::pointer_to_unary_function<int, int> PUF; // expected-warning {{'pointer_to_unary_function<int, int>' is deprecated}}
     typedef std::pointer_to_binary_function<int, int, int> PBF; // expected-warning {{'pointer_to_binary_function<int, int, int>' is deprecated}}
     std::ptr_fun<int, int>(identity); // expected-warning {{'ptr_fun<int, int>' is deprecated}}
@@ -50,6 +48,4 @@ int main(int, char**)
     std::mem_fun_ref<int, Foo, int>(&Foo::identity); // expected-warning {{'mem_fun_ref<int, Foo, int>' is deprecated}}
     std::mem_fun_ref<int, Foo>(&Foo::const_zero); // expected-warning {{'mem_fun_ref<int, Foo>' is deprecated}}
     std::mem_fun_ref<int, Foo, int>(&Foo::const_identity); // expected-warning {{'mem_fun_ref<int, Foo, int>' is deprecated}}
-
-  return 0;
 }

diff  --git a/libcxx/test/libcxx/diagnostics/nodiscard_aftercxx17.verify.cpp b/libcxx/test/libcxx/diagnostics/nodiscard_aftercxx17.verify.cpp
index 9e3796cb0078..242d935b7f00 100644
--- a/libcxx/test/libcxx/diagnostics/nodiscard_aftercxx17.verify.cpp
+++ b/libcxx/test/libcxx/diagnostics/nodiscard_aftercxx17.verify.cpp
@@ -16,9 +16,6 @@
 
 _LIBCPP_NODISCARD_AFTER_CXX17 int foo() { return 6; }
 
-int main(int, char**)
-{
+void f() {
     foo(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/libcxx/diagnostics/nodiscard_extensions.compile.pass.cpp b/libcxx/test/libcxx/diagnostics/nodiscard_extensions.compile.pass.cpp
index e0d457bd844b..0cc86e2a77cf 100644
--- a/libcxx/test/libcxx/diagnostics/nodiscard_extensions.compile.pass.cpp
+++ b/libcxx/test/libcxx/diagnostics/nodiscard_extensions.compile.pass.cpp
@@ -183,12 +183,10 @@ void test_nontemplate_cast_wrappers()
 #endif
 }
 
-int main(int, char**) {
+void tests() {
   test_algorithms();
 
   int i = 42;
   test_template_cast_wrappers(i, std::move(i));
   test_nontemplate_cast_wrappers();
-
-  return 0;
 }

diff  --git a/libcxx/test/libcxx/diagnostics/nodiscard_extensions.verify.cpp b/libcxx/test/libcxx/diagnostics/nodiscard_extensions.verify.cpp
index fe5fe24af555..3d0dd2ab22ad 100644
--- a/libcxx/test/libcxx/diagnostics/nodiscard_extensions.verify.cpp
+++ b/libcxx/test/libcxx/diagnostics/nodiscard_extensions.verify.cpp
@@ -349,12 +349,10 @@ void test_nontemplate_cast_wrappers()
 #endif
 }
 
-int main(int, char**) {
+void f() {
   test_algorithms();
 
   int i = 42;
   test_template_cast_wrappers(i, std::move(i));
   test_nontemplate_cast_wrappers();
-
-  return 0;
 }

diff  --git a/libcxx/test/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.cons/ctor.iter.explicit.verify.cpp b/libcxx/test/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.cons/ctor.iter.explicit.verify.cpp
index 95626bef2e89..6440e284f6a0 100644
--- a/libcxx/test/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.cons/ctor.iter.explicit.verify.cpp
+++ b/libcxx/test/libcxx/iterators/predef.iterators/__unconstrained_reverse_iterator/reverse.iter.cons/ctor.iter.explicit.verify.cpp
@@ -16,8 +16,7 @@
 
 #include <iterator>
 
-int main(int, char**) {
+void f() {
     char const* it = "";
     std::__unconstrained_reverse_iterator<char const*> r = it; // expected-error{{no viable conversion from 'const char *' to 'std::__unconstrained_reverse_iterator<const char *>'}}
-    return 0;
 }

diff  --git a/libcxx/test/libcxx/iterators/predef.iterators/reverse.iterators/bad_template_argument.verify.cpp b/libcxx/test/libcxx/iterators/predef.iterators/reverse.iterators/bad_template_argument.verify.cpp
index 4ccf85ea528e..1ad9ca9676ff 100644
--- a/libcxx/test/libcxx/iterators/predef.iterators/reverse.iterators/bad_template_argument.verify.cpp
+++ b/libcxx/test/libcxx/iterators/predef.iterators/reverse.iterators/bad_template_argument.verify.cpp
@@ -16,9 +16,7 @@
 
 #include "test_iterators.h"
 
-int main(int, char**) {
+void f() {
   using BadIter = std::reverse_iterator<forward_iterator<int*>>;
   BadIter i; //expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}reverse_iterator<It> requires It to be a bidirectional iterator.}}
-
-  return 0;
 }

diff  --git a/libcxx/test/libcxx/language.support/support.dynamic/aligned_alloc_availability.verify.cpp b/libcxx/test/libcxx/language.support/support.dynamic/aligned_alloc_availability.verify.cpp
index 6296bbddf547..c22d04dbf37f 100644
--- a/libcxx/test/libcxx/language.support/support.dynamic/aligned_alloc_availability.verify.cpp
+++ b/libcxx/test/libcxx/language.support/support.dynamic/aligned_alloc_availability.verify.cpp
@@ -23,8 +23,7 @@ constexpr auto OverAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__ * 2;
 
 struct alignas(OverAligned) A { };
 
-int main(int, char**)
-{
+void f() {
     // Normal versions
     {
         A *a1 = new A; // expected-error-re {{aligned allocation function of type {{.+}} is only available on}}

diff  --git a/libcxx/test/libcxx/numerics/rand/rand.device/has-no-random-device.verify.cpp b/libcxx/test/libcxx/numerics/rand/rand.device/has-no-random-device.verify.cpp
index 7559c88b59e9..03d592774e57 100644
--- a/libcxx/test/libcxx/numerics/rand/rand.device/has-no-random-device.verify.cpp
+++ b/libcxx/test/libcxx/numerics/rand/rand.device/has-no-random-device.verify.cpp
@@ -13,7 +13,6 @@
 
 #include <random>
 
-int main(int, char**) {
+void f() {
   std::random_device d; // expected-error {{no type named 'random_device' in namespace 'std'}}
-  return 0;
 }

diff  --git a/libcxx/test/libcxx/ranges/version.compile.pass.cpp b/libcxx/test/libcxx/ranges/version.compile.pass.cpp
index de955a91b8a4..4b3aa3f164d4 100644
--- a/libcxx/test/libcxx/ranges/version.compile.pass.cpp
+++ b/libcxx/test/libcxx/ranges/version.compile.pass.cpp
@@ -16,6 +16,3 @@
 #ifndef _LIBCPP_VERSION
 #error _LIBCPP_VERSION not defined
 #endif
-
-// Required for MSVC internal test runner compatibility.
-int main(int, char**) { return 0; }

diff  --git a/libcxx/test/libcxx/selftest/verify.cpp/no-werror.verify.cpp b/libcxx/test/libcxx/selftest/verify.cpp/no-werror.verify.cpp
index b1234ae62674..e96d6be9087b 100644
--- a/libcxx/test/libcxx/selftest/verify.cpp/no-werror.verify.cpp
+++ b/libcxx/test/libcxx/selftest/verify.cpp/no-werror.verify.cpp
@@ -10,7 +10,6 @@
 
 // ADDITIONAL_COMPILE_FLAGS: -Wunused-variable
 
-int main(int, char**) {
+void f() {
     int foo; // expected-warning {{unused variable}}
-    return 0;
 }

diff  --git a/libcxx/test/libcxx/thread/atomic.availability.verify.cpp b/libcxx/test/libcxx/thread/atomic.availability.verify.cpp
index e96d461a4572..91e7257c6024 100644
--- a/libcxx/test/libcxx/thread/atomic.availability.verify.cpp
+++ b/libcxx/test/libcxx/thread/atomic.availability.verify.cpp
@@ -9,15 +9,12 @@
 // UNSUPPORTED: c++03, c++11
 // REQUIRES: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
 
-
 // Test the availability markup on the C++20 Synchronization Library
 // additions to <atomic>.
 
 #include <atomic>
 
-
-int main(int, char**)
-{
+void f() {
     {
         std::atomic<int> i(3);
         std::memory_order m = std::memory_order_relaxed;

diff  --git a/libcxx/test/libcxx/thread/barrier.availability.verify.cpp b/libcxx/test/libcxx/thread/barrier.availability.verify.cpp
index 8da39fe3c2df..a9043854e61f 100644
--- a/libcxx/test/libcxx/thread/barrier.availability.verify.cpp
+++ b/libcxx/test/libcxx/thread/barrier.availability.verify.cpp
@@ -9,7 +9,6 @@
 // UNSUPPORTED: c++03, c++11
 // REQUIRES: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
 
-
 // Test the availability markup on std::barrier.
 
 #include <barrier>
@@ -19,8 +18,7 @@ struct CompletionF {
     void operator()() { }
 };
 
-int main(int, char**)
-{
+void f() {
     // Availability markup on std::barrier<>
     {
         std::barrier<> b(10); // expected-error {{is unavailable}}

diff  --git a/libcxx/test/libcxx/thread/latch.availability.verify.cpp b/libcxx/test/libcxx/thread/latch.availability.verify.cpp
index 8555e0e70267..ceb2c19f7959 100644
--- a/libcxx/test/libcxx/thread/latch.availability.verify.cpp
+++ b/libcxx/test/libcxx/thread/latch.availability.verify.cpp
@@ -9,14 +9,11 @@
 // UNSUPPORTED: c++03, c++11
 // REQUIRES: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
 
-
 // Test the availability markup on std::latch.
 
 #include <latch>
 
-
-int main(int, char**)
-{
+void f() {
     std::latch latch(10);
     latch.count_down(); // expected-error {{is unavailable}}
     latch.count_down(3); // expected-error {{is unavailable}}

diff  --git a/libcxx/test/libcxx/thread/semaphore.availability.verify.cpp b/libcxx/test/libcxx/thread/semaphore.availability.verify.cpp
index a6d5c3667828..8434e0e76f60 100644
--- a/libcxx/test/libcxx/thread/semaphore.availability.verify.cpp
+++ b/libcxx/test/libcxx/thread/semaphore.availability.verify.cpp
@@ -9,15 +9,12 @@
 // UNSUPPORTED: c++03, c++11
 // REQUIRES: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
 
-
 // Test the availability markup on std::counting_semaphore and std::binary_semaphore.
 
 #include <chrono>
 #include <semaphore>
 
-
-int main(int, char**)
-{
+void f() {
     {
         // Tests for std::counting_semaphore with non-default template argument
         std::counting_semaphore<20> sem(10);

diff  --git a/libcxx/test/libcxx/thread/thread.barrier/version.compile.pass.cpp b/libcxx/test/libcxx/thread/thread.barrier/version.compile.pass.cpp
index 7890787b6a2a..fb80bb035bbc 100644
--- a/libcxx/test/libcxx/thread/thread.barrier/version.compile.pass.cpp
+++ b/libcxx/test/libcxx/thread/thread.barrier/version.compile.pass.cpp
@@ -18,8 +18,3 @@
 #ifndef _LIBCPP_VERSION
 #error _LIBCPP_VERSION not defined
 #endif
-
-int main(int, char**)
-{
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/thread/thread.latch/version.compile.pass.cpp b/libcxx/test/libcxx/thread/thread.latch/version.compile.pass.cpp
index 365ee9276be1..559c827d8131 100644
--- a/libcxx/test/libcxx/thread/thread.latch/version.compile.pass.cpp
+++ b/libcxx/test/libcxx/thread/thread.latch/version.compile.pass.cpp
@@ -18,8 +18,3 @@
 #ifndef _LIBCPP_VERSION
 #error _LIBCPP_VERSION not defined
 #endif
-
-int main(int, char**)
-{
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/thread/thread.lock/thread.lock.guard/nodiscard.verify.cpp b/libcxx/test/libcxx/thread/thread.lock/thread.lock.guard/nodiscard.verify.cpp
index c0cad32da198..5fe68c83b3d9 100644
--- a/libcxx/test/libcxx/thread/thread.lock/thread.lock.guard/nodiscard.verify.cpp
+++ b/libcxx/test/libcxx/thread/thread.lock/thread.lock.guard/nodiscard.verify.cpp
@@ -23,9 +23,8 @@
 
 #include <mutex>
 
-int main(int, char**) {
+void f() {
     std::mutex m;
     std::lock_guard<std::mutex>{m}; // expected-warning {{ignoring temporary created by a constructor declared with 'nodiscard' attribute}}
     std::lock_guard<std::mutex>{m, std::adopt_lock}; // expected-warning {{ignoring temporary created by a constructor declared with 'nodiscard' attribute}}
-    return 0;
 }

diff  --git a/libcxx/test/libcxx/thread/thread.semaphore/version.compile.pass.cpp b/libcxx/test/libcxx/thread/thread.semaphore/version.compile.pass.cpp
index 3f59448a8524..9eaf1ad7e7bb 100644
--- a/libcxx/test/libcxx/thread/thread.semaphore/version.compile.pass.cpp
+++ b/libcxx/test/libcxx/thread/thread.semaphore/version.compile.pass.cpp
@@ -18,8 +18,3 @@
 #ifndef _LIBCPP_VERSION
 #error _LIBCPP_VERSION not defined
 #endif
-
-int main(int, char**)
-{
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/utilities/format/version.compile.pass.cpp b/libcxx/test/libcxx/utilities/format/version.compile.pass.cpp
index 4c1be774a9a6..f4fa83951c14 100644
--- a/libcxx/test/libcxx/utilities/format/version.compile.pass.cpp
+++ b/libcxx/test/libcxx/utilities/format/version.compile.pass.cpp
@@ -17,6 +17,3 @@
 #ifndef _LIBCPP_VERSION
 #  error _LIBCPP_VERSION not defined
 #endif
-
-// Required for MSVC internal test runner compatibility.
-int main(int, char**) { return 0; }

diff  --git a/libcxx/test/std/atomics/atomics.types.generic/standard_layout.compile.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/standard_layout.compile.pass.cpp
index d7987ca2dc60..ca17657177f3 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/standard_layout.compile.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/standard_layout.compile.pass.cpp
@@ -25,10 +25,8 @@ struct CheckStandardLayout {
   }
 };
 
-int main(int, char**) {
+void tests() {
   TestEachIntegralType<CheckStandardLayout>()();
   TestEachFloatingPointType<CheckStandardLayout>()();
   TestEachPointerType<CheckStandardLayout>()();
-
-  return 0;
 }

diff  --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/copy.assign.ptr.volatile.verify.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/copy.assign.ptr.volatile.verify.cpp
index 2d1acb623ed5..d85f8a844373 100644
--- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/copy.assign.ptr.volatile.verify.cpp
+++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/copy.assign.ptr.volatile.verify.cpp
@@ -14,8 +14,7 @@
 
 #include <atomic>
 
-int main(int, char**)
-{
+void f() {
     volatile std::atomic<int*> obj1;
     std::atomic<int*> obj2;
     obj1 = obj2; // expected-error {{overload resolution selected deleted operator '='}}

diff  --git a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/copy.assign.volatile.verify.cpp b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/copy.assign.volatile.verify.cpp
index 07e1181edf2b..e72ccf1a2613 100644
--- a/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/copy.assign.volatile.verify.cpp
+++ b/libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/copy.assign.volatile.verify.cpp
@@ -14,8 +14,7 @@
 
 #include <atomic>
 
-int main(int, char**)
-{
+void f() {
   volatile std::atomic<int> obj1;
   std::atomic<int> obj2;
   obj1 = obj2; // expected-error {{overload resolution selected deleted operator '='}}

diff  --git a/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable.compile.pass.cpp b/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable.compile.pass.cpp
index b58dae347db0..126606ef7ab3 100644
--- a/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable.compile.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable.compile.pass.cpp
@@ -141,5 +141,3 @@ static_assert(std::equality_comparable<ge_returns_explicit_bool>);
 static_assert(std::equality_comparable<returns_true_type>);
 static_assert(std::equality_comparable<returns_int_ptr>);
 } // namespace types_fit_for_purpose
-
-int main(int, char**) { return 0; }

diff  --git a/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable_with.compile.pass.cpp b/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable_with.compile.pass.cpp
index ba8138f667f9..e0edd1f332f8 100644
--- a/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable_with.compile.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable_with.compile.pass.cpp
@@ -1120,5 +1120,3 @@ static_assert(
 static_assert(
     !check_equality_comparable_with<one_way_ne, explicit_operators>());
 } // namespace types_fit_for_purpose
-
-int main(int, char**) { return 0; }

diff  --git a/libcxx/test/std/concepts/concepts.lang/concept.common/common_with.compile.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.common/common_with.compile.pass.cpp
index c14634e79466..5d80c1cba265 100644
--- a/libcxx/test/std/concepts/concepts.lang/concept.common/common_with.compile.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.lang/concept.common/common_with.compile.pass.cpp
@@ -990,5 +990,3 @@ struct common_type<const volatile int&, const volatile CommonWithIntButRefLong&>
     : common_type<CommonWithIntButRefLong&, int&> {};
 } // namespace std
 static_assert(CheckCommonWith<CommonWithIntButRefLong, int>());
-
-int main(int, char**) { return 0; }

diff  --git a/libcxx/test/std/concepts/concepts.lang/concept.commonref/common_reference.compile.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.commonref/common_reference.compile.pass.cpp
index e7ab52025af1..7c37dafc2d69 100644
--- a/libcxx/test/std/concepts/concepts.lang/concept.commonref/common_reference.compile.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.lang/concept.commonref/common_reference.compile.pass.cpp
@@ -343,5 +343,3 @@ struct basic_common_reference<int, HasCommonReference, X, Y> {
 } // namespace std
 static_assert(!std::common_reference_with<HasCommonReference, int>);
 static_assert(std::common_reference_with<HasCommonReference, int&>);
-
-int main(int, char**) { return 0; }

diff  --git a/libcxx/test/std/concepts/concepts.lang/concept.constructible/constructible_from.compile.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.constructible/constructible_from.compile.pass.cpp
index 22a70bd7d653..fe0ecece3382 100644
--- a/libcxx/test/std/concepts/concepts.lang/concept.constructible/constructible_from.compile.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.lang/concept.constructible/constructible_from.compile.pass.cpp
@@ -148,5 +148,3 @@ void test() {
   test<std::array<int, 1>, int>();
   test<std::array<int, 1>, int, int>();
 }
-
-int main(int, char**) { return 0; }

diff  --git a/libcxx/test/std/concepts/concepts.lang/concept.copyconstructible/copy_constructible.compile.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.copyconstructible/copy_constructible.compile.pass.cpp
index cc349bef1848..4a14155eddff 100644
--- a/libcxx/test/std/concepts/concepts.lang/concept.copyconstructible/copy_constructible.compile.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.lang/concept.copyconstructible/copy_constructible.compile.pass.cpp
@@ -172,5 +172,3 @@ struct ExplicitlyCopyable {
 };
 static_assert(!std::copy_constructible<ExplicitlyCopyable>);
 } // namespace CopyConstructibleTests
-
-int main(int, char**) { return 0; }

diff  --git a/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
index 340c29fe1b9c..4921a48bcccc 100644
--- a/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
@@ -261,8 +261,3 @@ void test()
     test_true     <std::weak_ptr<int>>();
 
 }
-
-// Required for MSVC internal test runner compatibility.
-int main(int, char**) {
-    return 0;
-}

diff  --git a/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.verify.cpp b/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.verify.cpp
index ec788eef1fe2..88a75d030c73 100644
--- a/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.verify.cpp
+++ b/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.verify.cpp
@@ -65,9 +65,3 @@ void test() {
     LIBCPP_STATIC_ASSERT(!std::__default_initializable<const int[]>);
     static_assert(!std::default_initializable<const int[]>);
 }
-
-int main(int, char**) {
-    test();
-
-    return 0;
-}

diff  --git a/libcxx/test/std/concepts/concepts.lang/concept.destructible/destructible.compile.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.destructible/destructible.compile.pass.cpp
index aa86f59efc78..10c61336f67a 100644
--- a/libcxx/test/std/concepts/concepts.lang/concept.destructible/destructible.compile.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.lang/concept.destructible/destructible.compile.pass.cpp
@@ -73,6 +73,3 @@ void test() {
   test<int>();
   test<double>();
 }
-
-// Required for MSVC internal test runner compatibility.
-int main(int, char**) { return 0; }

diff  --git a/libcxx/test/std/concepts/concepts.lang/concept.moveconstructible/move_constructible.compile.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.moveconstructible/move_constructible.compile.pass.cpp
index b4003d9cc69c..d388248c05ac 100644
--- a/libcxx/test/std/concepts/concepts.lang/concept.moveconstructible/move_constructible.compile.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.lang/concept.moveconstructible/move_constructible.compile.pass.cpp
@@ -76,5 +76,3 @@ static_assert(std::move_constructible<const ImplicitlyDeletedMoveAssign&&>);
 static_assert(!std::move_constructible<NonMovable>);
 static_assert(!std::move_constructible<DerivedFromNonMovable>);
 static_assert(!std::move_constructible<HasANonMovable>);
-
-int main(int, char**) { return 0; }

diff  --git a/libcxx/test/std/concepts/concepts.object/copyable.compile.pass.cpp b/libcxx/test/std/concepts/concepts.object/copyable.compile.pass.cpp
index a92b6c4fe007..accd6141dae8 100644
--- a/libcxx/test/std/concepts/concepts.object/copyable.compile.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.object/copyable.compile.pass.cpp
@@ -113,5 +113,3 @@ static_assert(
     !std::assignable_from<deleted_assignment_from_const_rvalue&,
                           deleted_assignment_from_const_rvalue const>);
 static_assert(!std::copyable<deleted_assignment_from_const_rvalue>);
-
-int main(int, char**) { return 0; }

diff  --git a/libcxx/test/std/concepts/concepts.object/movable.compile.pass.cpp b/libcxx/test/std/concepts/concepts.object/movable.compile.pass.cpp
index c5879beec3df..07a518d7fe1f 100644
--- a/libcxx/test/std/concepts/concepts.object/movable.compile.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.object/movable.compile.pass.cpp
@@ -133,5 +133,3 @@ static_assert(std::movable<deleted_assignment_from_const_rvalue>);
 
 // `move_constructible and assignable_from<T&, T>` implies `swappable<T>`,
 // so there's nothing to test for the case of non-swappable.
-
-int main(int, char**) { return 0; }

diff  --git a/libcxx/test/std/concepts/concepts.object/regular.compile.pass.cpp b/libcxx/test/std/concepts/concepts.object/regular.compile.pass.cpp
index b1a1709f51f5..ab5472f6c391 100644
--- a/libcxx/test/std/concepts/concepts.object/regular.compile.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.object/regular.compile.pass.cpp
@@ -163,5 +163,3 @@ struct is_equality_comparable {
   bool operator==(is_equality_comparable const&) const = default;
 };
 static_assert(std::regular<is_equality_comparable>);
-
-int main(int, char**) { return 0; }

diff  --git a/libcxx/test/std/concepts/concepts.object/semiregular.compile.pass.cpp b/libcxx/test/std/concepts/concepts.object/semiregular.compile.pass.cpp
index fed5f03f275b..7151c1c8bb31 100644
--- a/libcxx/test/std/concepts/concepts.object/semiregular.compile.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.object/semiregular.compile.pass.cpp
@@ -126,5 +126,3 @@ static_assert(!std::semiregular<has_non_default_initializable>);
 static_assert(!std::semiregular<deleted_default_ctor>);
 static_assert(!std::semiregular<derived_from_deleted_default_ctor>);
 static_assert(!std::semiregular<has_deleted_default_ctor>);
-
-int main(int, char**) { return 0; }

diff  --git a/libcxx/test/std/containers/associative/map/map.access/empty.verify.cpp b/libcxx/test/std/containers/associative/map/map.access/empty.verify.cpp
index 1430591fdf6d..27ca7c66cceb 100644
--- a/libcxx/test/std/containers/associative/map/map.access/empty.verify.cpp
+++ b/libcxx/test/std/containers/associative/map/map.access/empty.verify.cpp
@@ -16,12 +16,7 @@
 
 #include <map>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     std::map<int, int> c;
     c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/containers/associative/multimap/empty.verify.cpp b/libcxx/test/std/containers/associative/multimap/empty.verify.cpp
index dcd3b58e0283..8720497c35fd 100644
--- a/libcxx/test/std/containers/associative/multimap/empty.verify.cpp
+++ b/libcxx/test/std/containers/associative/multimap/empty.verify.cpp
@@ -16,12 +16,7 @@
 
 #include <map>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     std::multimap<int, int> c;
     c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/containers/associative/multiset/empty.verify.cpp b/libcxx/test/std/containers/associative/multiset/empty.verify.cpp
index 87c02e4581d1..0de93052ad79 100644
--- a/libcxx/test/std/containers/associative/multiset/empty.verify.cpp
+++ b/libcxx/test/std/containers/associative/multiset/empty.verify.cpp
@@ -16,12 +16,7 @@
 
 #include <set>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     std::multiset<int> c;
     c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/containers/associative/set/empty.verify.cpp b/libcxx/test/std/containers/associative/set/empty.verify.cpp
index 0e7b28da152b..e0405f70e67d 100644
--- a/libcxx/test/std/containers/associative/set/empty.verify.cpp
+++ b/libcxx/test/std/containers/associative/set/empty.verify.cpp
@@ -16,12 +16,7 @@
 
 #include <set>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     std::set<int> c;
     c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.members/empty.verify.cpp b/libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.members/empty.verify.cpp
index 7976b96cd76a..793f47d12c20 100644
--- a/libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.members/empty.verify.cpp
+++ b/libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.members/empty.verify.cpp
@@ -16,12 +16,7 @@
 
 #include <queue>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     std::priority_queue<int> c;
     c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/containers/container.adaptors/queue/queue.defn/empty.verify.cpp b/libcxx/test/std/containers/container.adaptors/queue/queue.defn/empty.verify.cpp
index 9a8761a51992..5f24ef0e77fc 100644
--- a/libcxx/test/std/containers/container.adaptors/queue/queue.defn/empty.verify.cpp
+++ b/libcxx/test/std/containers/container.adaptors/queue/queue.defn/empty.verify.cpp
@@ -16,12 +16,7 @@
 
 #include <queue>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     std::queue<int> c;
     c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/containers/container.adaptors/stack/stack.defn/empty.verify.cpp b/libcxx/test/std/containers/container.adaptors/stack/stack.defn/empty.verify.cpp
index 8264092b5fce..e9af144c858b 100644
--- a/libcxx/test/std/containers/container.adaptors/stack/stack.defn/empty.verify.cpp
+++ b/libcxx/test/std/containers/container.adaptors/stack/stack.defn/empty.verify.cpp
@@ -16,12 +16,7 @@
 
 #include <stack>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     std::stack<int> c;
     c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/containers/sequences/array/empty.verify.cpp b/libcxx/test/std/containers/sequences/array/empty.verify.cpp
index 6fa851f178c8..9cf8f1156990 100644
--- a/libcxx/test/std/containers/sequences/array/empty.verify.cpp
+++ b/libcxx/test/std/containers/sequences/array/empty.verify.cpp
@@ -16,15 +16,9 @@
 
 #include <array>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
-
+void f() {
     std::array<int, 1> c;
     c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
     std::array<int, 0> c0;
     c0.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/containers/sequences/deque/deque.capacity/empty.verify.cpp b/libcxx/test/std/containers/sequences/deque/deque.capacity/empty.verify.cpp
index 01822e28f84d..a2295088c0a9 100644
--- a/libcxx/test/std/containers/sequences/deque/deque.capacity/empty.verify.cpp
+++ b/libcxx/test/std/containers/sequences/deque/deque.capacity/empty.verify.cpp
@@ -16,12 +16,7 @@
 
 #include <deque>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     std::deque<int> c;
     c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/containers/sequences/forwardlist/empty.verify.cpp b/libcxx/test/std/containers/sequences/forwardlist/empty.verify.cpp
index 4092f443f387..366094b09e88 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/empty.verify.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/empty.verify.cpp
@@ -16,12 +16,7 @@
 
 #include <forward_list>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     std::forward_list<int> c;
     c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/containers/sequences/list/list.capacity/empty.verify.cpp b/libcxx/test/std/containers/sequences/list/list.capacity/empty.verify.cpp
index 4edf426c6eee..77d4e5ab2138 100644
--- a/libcxx/test/std/containers/sequences/list/list.capacity/empty.verify.cpp
+++ b/libcxx/test/std/containers/sequences/list/list.capacity/empty.verify.cpp
@@ -16,12 +16,7 @@
 
 #include <list>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     std::list<int> c;
     c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/containers/sequences/vector.bool/empty.verify.cpp b/libcxx/test/std/containers/sequences/vector.bool/empty.verify.cpp
index 06c968e59c84..167e095b798f 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/empty.verify.cpp
+++ b/libcxx/test/std/containers/sequences/vector.bool/empty.verify.cpp
@@ -16,12 +16,7 @@
 
 #include <vector>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     std::vector<bool> c;
     c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/containers/sequences/vector/vector.capacity/empty.verify.cpp b/libcxx/test/std/containers/sequences/vector/vector.capacity/empty.verify.cpp
index df3b4960343e..4cea844f1e35 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.capacity/empty.verify.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.capacity/empty.verify.cpp
@@ -16,12 +16,7 @@
 
 #include <vector>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     std::vector<int> c;
     c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/containers/sequences/vector/vector.cons/copy.move_only.verify.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/copy.move_only.verify.cpp
index 913010435d11..f716eccf94e3 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.cons/copy.move_only.verify.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.cons/copy.move_only.verify.cpp
@@ -14,9 +14,7 @@
 
 #include "MoveOnly.h"
 
-int main(int, char**)
-{
+void f() {
     std::vector<MoveOnly> v;
     std::vector<MoveOnly> copy = v; // expected-error-re@* {{{{(no matching function for call to 'construct_at')|(call to implicitly-deleted copy constructor of 'MoveOnly')|(call to deleted constructor of 'MoveOnly')}}}}
-    return 0;
 }

diff  --git a/libcxx/test/std/containers/unord/unord.map/empty.verify.cpp b/libcxx/test/std/containers/unord/unord.map/empty.verify.cpp
index 269250be9f65..ada96fdf8915 100644
--- a/libcxx/test/std/containers/unord/unord.map/empty.verify.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/empty.verify.cpp
@@ -16,12 +16,7 @@
 
 #include <unordered_map>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     std::unordered_map<int, int> c;
     c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/containers/unord/unord.multimap/empty.verify.cpp b/libcxx/test/std/containers/unord/unord.multimap/empty.verify.cpp
index aead051866cb..999d43fb63bc 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/empty.verify.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/empty.verify.cpp
@@ -16,12 +16,7 @@
 
 #include <unordered_map>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     std::unordered_multimap<int, int> c;
     c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/containers/unord/unord.multiset/empty.verify.cpp b/libcxx/test/std/containers/unord/unord.multiset/empty.verify.cpp
index 547dd81b7748..8f5fa55c3aef 100644
--- a/libcxx/test/std/containers/unord/unord.multiset/empty.verify.cpp
+++ b/libcxx/test/std/containers/unord/unord.multiset/empty.verify.cpp
@@ -16,12 +16,7 @@
 
 #include <unordered_set>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     std::unordered_multiset<int> c;
     c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/containers/unord/unord.set/empty.verify.cpp b/libcxx/test/std/containers/unord/unord.set/empty.verify.cpp
index 4a739a37a649..e2164415aa18 100644
--- a/libcxx/test/std/containers/unord/unord.set/empty.verify.cpp
+++ b/libcxx/test/std/containers/unord/unord.set/empty.verify.cpp
@@ -16,12 +16,7 @@
 
 #include <unordered_set>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     std::unordered_set<int> c;
     c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/containers/views/views.span/span.cons/iterator_len.verify.cpp b/libcxx/test/std/containers/views/views.span/span.cons/iterator_len.verify.cpp
index 0372e00b789b..dc287cbe8311 100644
--- a/libcxx/test/std/containers/views/views.span/span.cons/iterator_len.verify.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.cons/iterator_len.verify.cpp
@@ -22,7 +22,7 @@ std::span<T, extent> createImplicitSpan(T* ptr, size_t len) {
   return {ptr, len}; // expected-error {{chosen constructor is explicit in copy-initialization}}
 }
 
-int main(int, char**) {
+void f() {
   // explicit constructor necessary
   int arr[] = {1, 2, 3};
   createImplicitSpan<int, 1>(arr, 3);
@@ -31,6 +31,4 @@ int main(int, char**) {
   std::span<int, 2> sp2 = {0, 0}; // expected-error {{no matching constructor for initialization of 'std::span<int, 2>'}}
   std::span<const int> csp = {0, 0}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}}
   std::span<const int, 2> csp2 = {0, 0}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 2>'}}
-
-  return 0;
 }

diff  --git a/libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.verify.cpp b/libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.verify.cpp
index 9ac9a03da6ea..d0d81df313d3 100644
--- a/libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.verify.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.cons/iterator_sentinel.verify.cpp
@@ -18,16 +18,13 @@
 #include <span>
 #include <iterator>
 
-
 template<class T, size_t Extent>
 std::span<T, Extent> createImplicitSpan(T* first, T* last) {
     return {first, last}; // expected-error {{chosen constructor is explicit in copy-initialization}}
 }
 
-int main(int, char**) {
+void f() {
   // explicit constructor necessary
   int arr[] = {1, 2, 3};
   createImplicitSpan<int, 1>(std::begin(arr), std::end(arr));
-
-  return 0;
 }

diff  --git a/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.verify.cpp b/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.verify.cpp
index 93cfbb60a7d7..00ae30908da0 100644
--- a/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.verify.cpp
+++ b/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.verify.cpp
@@ -16,11 +16,7 @@
 #include <functional>
 
 #include "../test_func.h"
-#include "test_macros.h"
 
-int main(int, char**)
-{
+void f() {
     std::bind1st(test_func(1), 5); // expected-warning {{'bind1st<test_func, int>' is deprecated}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.verify.cpp b/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.verify.cpp
index 3e55db60572d..c1c78ecc6241 100644
--- a/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.verify.cpp
+++ b/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.verify.cpp
@@ -16,11 +16,7 @@
 #include <functional>
 
 #include "../test_func.h"
-#include "test_macros.h"
 
-int main(int, char**)
-{
+void f() {
     std::bind2nd(test_func(1), 5); // expected-warning {{'bind2nd<test_func, int>' is deprecated}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.verify.cpp b/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.verify.cpp
index 5048d7b2ea1e..c1b7c687a196 100644
--- a/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.verify.cpp
+++ b/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.verify.cpp
@@ -16,11 +16,5 @@
 #include <functional>
 
 #include "../test_func.h"
-#include "test_macros.h"
 
-int main(int, char**)
-{
-    typedef std::binder1st<test_func> B1ST; // expected-warning {{'binder1st<test_func>' is deprecated}}
-
-    return 0;
-}
+typedef std::binder1st<test_func> B1ST; // expected-warning {{'binder1st<test_func>' is deprecated}}

diff  --git a/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.verify.cpp b/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.verify.cpp
index 5a883ab040f4..fa25fa0e6826 100644
--- a/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.verify.cpp
+++ b/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.verify.cpp
@@ -16,11 +16,5 @@
 #include <functional>
 
 #include "../test_func.h"
-#include "test_macros.h"
 
-int main(int, char**)
-{
-    typedef std::binder2nd<test_func> B2ND; // expected-warning {{'binder2nd<test_func>' is deprecated}}
-
-    return 0;
-}
+typedef std::binder2nd<test_func> B2ND; // expected-warning {{'binder2nd<test_func>' is deprecated}}

diff  --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.decompose/empty.verify.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.decompose/empty.verify.cpp
index 75e88e0b499d..32bbc4c21073 100644
--- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.decompose/empty.verify.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.decompose/empty.verify.cpp
@@ -16,12 +16,7 @@
 
 #include "filesystem_include.h"
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     fs::path c;
     c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_char.verify.cpp b/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_char.verify.cpp
index 4d9635183d66..22013cd6f4ed 100644
--- a/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_char.verify.cpp
+++ b/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_char.verify.cpp
@@ -16,9 +16,6 @@
 #include <iomanip>
 #include <sstream>
 #include <string>
-#include <cassert>
-
-#include "test_macros.h"
 
 //  Test that mismatches between strings and wide streams are diagnosed
 
@@ -29,6 +26,6 @@ void round_trip ( const char *p ) {
     ss >> std::quoted(s); // expected-error {{invalid operands to binary expression}}
 }
 
-int main(int, char**) {
+void f() {
     round_trip("Hi Mom");
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_traits.verify.cpp b/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_traits.verify.cpp
index 5a92485ced56..e457adb5edda 100644
--- a/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_traits.verify.cpp
+++ b/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_traits.verify.cpp
@@ -15,9 +15,6 @@
 #include <iomanip>
 #include <sstream>
 #include <string>
-#include <cassert>
-
-#include "test_macros.h"
 
 //  Test that mismatches in the traits between the quoted object and the dest string are diagnosed.
 
@@ -33,6 +30,6 @@ void round_trip ( const char *p ) {
     ss >> std::quoted(s); // expected-error {{invalid operands to binary expression}}
 }
 
-int main(int, char**) {
+void f() {
     round_trip("Hi Mom");
 }

diff  --git a/libcxx/test/std/iterators/iterator.container/empty.array.verify.cpp b/libcxx/test/std/iterators/iterator.container/empty.array.verify.cpp
index e67d864670f0..c60c752d413d 100644
--- a/libcxx/test/std/iterators/iterator.container/empty.array.verify.cpp
+++ b/libcxx/test/std/iterators/iterator.container/empty.array.verify.cpp
@@ -13,15 +13,9 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 
-#include <vector>
 #include <iterator>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     int c[5];
     std::empty(c); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/iterators/iterator.container/empty.container.verify.cpp b/libcxx/test/std/iterators/iterator.container/empty.container.verify.cpp
index 44b102efa0d1..6fbaa052ac24 100644
--- a/libcxx/test/std/iterators/iterator.container/empty.container.verify.cpp
+++ b/libcxx/test/std/iterators/iterator.container/empty.container.verify.cpp
@@ -16,12 +16,7 @@
 #include <vector>
 #include <iterator>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     std::vector<int> c;
     std::empty(c); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/iterators/iterator.container/empty.initializer_list.verify.cpp b/libcxx/test/std/iterators/iterator.container/empty.initializer_list.verify.cpp
index f97534da42c0..416931f1db68 100644
--- a/libcxx/test/std/iterators/iterator.container/empty.initializer_list.verify.cpp
+++ b/libcxx/test/std/iterators/iterator.container/empty.initializer_list.verify.cpp
@@ -16,12 +16,7 @@
 #include <initializer_list>
 #include <iterator>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     std::initializer_list<int> c = { 4 };
     std::empty(c); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.move/iter_move.nodiscard.verify.cpp b/libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.move/iter_move.nodiscard.verify.cpp
index f531b3ab37fe..ed4061f726b1 100644
--- a/libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.move/iter_move.nodiscard.verify.cpp
+++ b/libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.move/iter_move.nodiscard.verify.cpp
@@ -24,12 +24,10 @@ struct WithADL {
   friend constexpr auto iter_move(WithADL&) { return 0; }
 };
 
-int main(int, char**) {
+void f() {
   int* noADL = nullptr;
   std::ranges::iter_move(noADL); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
 
   WithADL adl;
   std::ranges::iter_move(adl); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-  return 0;
 }

diff  --git a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/ctor.iter.explicit.verify.cpp b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/ctor.iter.explicit.verify.cpp
index b14111555966..5b609f8cb6dc 100644
--- a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/ctor.iter.explicit.verify.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/ctor.iter.explicit.verify.cpp
@@ -16,8 +16,7 @@
 
 #include <iterator>
 
-int main(int, char**) {
+void f() {
     char const* it = "";
     std::move_iterator<char const*> r = it; // expected-error{{no viable conversion from 'const char *' to 'std::move_iterator<const char *>'}}
-    return 0;
 }

diff  --git a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.ref/deprecated.verify.cpp b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.ref/deprecated.verify.cpp
index 8c1684f0319d..e4e22cb5ac7c 100644
--- a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.ref/deprecated.verify.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.ref/deprecated.verify.cpp
@@ -12,9 +12,6 @@
 
 #include <iterator>
 
-int main(int, char**) {
-  (void)std::move_iterator<int*>().operator->();
-  // expected-warning at -1{{'operator->' is deprecated}}
-
-  return 0;
+void f() {
+  (void)std::move_iterator<int*>().operator->(); // expected-warning {{'operator->' is deprecated}}
 }

diff  --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.iter.explicit.verify.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.iter.explicit.verify.cpp
index 940848b300ee..d69799de27dc 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.iter.explicit.verify.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.iter.explicit.verify.cpp
@@ -16,8 +16,7 @@
 
 #include <iterator>
 
-int main(int, char**) {
+void f() {
     char const* it = "";
     std::reverse_iterator<char const*> r = it; // expected-error{{no viable conversion from 'const char *' to 'std::reverse_iterator<const char *>'}}
-    return 0;
 }

diff  --git a/libcxx/test/std/language.support/cmp/cmp.categories.pre/zero_type.verify.cpp b/libcxx/test/std/language.support/cmp/cmp.categories.pre/zero_type.verify.cpp
index 6d2687f599fa..8e3c793de4b9 100644
--- a/libcxx/test/std/language.support/cmp/cmp.categories.pre/zero_type.verify.cpp
+++ b/libcxx/test/std/language.support/cmp/cmp.categories.pre/zero_type.verify.cpp
@@ -50,9 +50,8 @@ void test_category(T v) {
   TEST_PASS(v, <=>);
 }
 
-int main(int, char**) {
+void f() {
   test_category(std::strong_ordering::equivalent);
   test_category(std::weak_ordering::equivalent);
   test_category(std::partial_ordering::equivalent);
-  return 0;
 }

diff  --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.verify.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.verify.cpp
index efd84bb57967..8e979165219d 100644
--- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.verify.cpp
+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.verify.cpp
@@ -17,7 +17,6 @@
 
 #include <new>
 
-int main(int, char**) {
+void f() {
     ::operator new[](4);  // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-    return 0;
 }

diff  --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.verify.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.verify.cpp
index 1551a057bac1..530e152c5e41 100644
--- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.verify.cpp
+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.verify.cpp
@@ -21,7 +21,6 @@
 
 #include <new>
 
-int main(int, char**) {
+void f() {
     ::operator new[](4, std::align_val_t{4});  // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-    return 0;
 }

diff  --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.verify.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.verify.cpp
index ec819627aa5a..33100736299c 100644
--- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.verify.cpp
+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.verify.cpp
@@ -21,7 +21,6 @@
 
 #include <new>
 
-int main(int, char**) {
+void f() {
     ::operator new[](4, std::align_val_t{4}, std::nothrow);  // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-    return 0;
 }

diff  --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.verify.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.verify.cpp
index 066ca1a23a10..fd954d4e70fc 100644
--- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.verify.cpp
+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.verify.cpp
@@ -17,7 +17,6 @@
 
 #include <new>
 
-int main(int, char**) {
+void f() {
     ::operator new[](4, std::nothrow);  // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-    return 0;
 }

diff  --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.verify.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.verify.cpp
index b5ec8248b9fa..b1b2f0f13882 100644
--- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.verify.cpp
+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.verify.cpp
@@ -14,12 +14,7 @@
 
 #include <new>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     char buffer[100];
     ::operator new[](4, buffer); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.verify.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.verify.cpp
index 502986434953..e98144ebd08d 100644
--- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.verify.cpp
+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.verify.cpp
@@ -14,12 +14,7 @@
 
 #include <new>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     char buffer[100];
     ::operator new(4, buffer); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size.verify.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size.verify.cpp
index ed6607847f29..d3ed46e7052b 100644
--- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size.verify.cpp
+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size.verify.cpp
@@ -14,11 +14,6 @@
 
 #include <new>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     ::operator new(4); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.verify.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.verify.cpp
index 2a30e15640d9..42a88615734a 100644
--- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.verify.cpp
+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.verify.cpp
@@ -21,7 +21,6 @@
 
 #include <new>
 
-int main(int, char**) {
+void f() {
     ::operator new(4, std::align_val_t{4});  // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-    return 0;
 }

diff  --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.verify.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.verify.cpp
index 047e81d1c975..8dcdbe3ca28e 100644
--- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.verify.cpp
+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.verify.cpp
@@ -21,7 +21,6 @@
 
 #include <new>
 
-int main(int, char**) {
+void f() {
     ::operator new(4, std::align_val_t{4}, std::nothrow);  // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-    return 0;
 }

diff  --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_nothrow.verify.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_nothrow.verify.cpp
index 4826cb41d545..081769b7c484 100644
--- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_nothrow.verify.cpp
+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_nothrow.verify.cpp
@@ -14,11 +14,6 @@
 
 #include <new>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     ::operator new(4, std::nothrow); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/language.support/support.dynamic/ptr.launder/launder.nodiscard.verify.cpp b/libcxx/test/std/language.support/support.dynamic/ptr.launder/launder.nodiscard.verify.cpp
index 632ca0e1a23b..f8e6cb2e55d2 100644
--- a/libcxx/test/std/language.support/support.dynamic/ptr.launder/launder.nodiscard.verify.cpp
+++ b/libcxx/test/std/language.support/support.dynamic/ptr.launder/launder.nodiscard.verify.cpp
@@ -11,17 +11,11 @@
 // template <class T> constexpr T* launder(T* p) noexcept;
 
 // UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORETD: c++17 && !stdlib=libc++
+// UNSUPPORTED: c++17 && !stdlib=libc++
 
 #include <new>
-#include <cassert>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     int *p = nullptr;
     std::launder(p); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char16_t_char.depr_in_cxx20.verify.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char16_t_char.depr_in_cxx20.verify.cpp
index c430321699a6..5beeed95da48 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char16_t_char.depr_in_cxx20.verify.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char16_t_char.depr_in_cxx20.verify.cpp
@@ -16,14 +16,10 @@
 #include <locale>
 
 #include "../with_public_dtor.hpp"
-#include "test_macros.h"
 
-int main(int, char **)
-{
+void f() {
     // Don't test for the exact type since the underlying type of
     // std::mbstate_t depends on implementation details.
     with_public_dtor<std::codecvt_byname<char16_t, char, std::mbstate_t>> cvt("", 0); // expected-warning-re {{'codecvt_byname<char16_t, char, {{.*}}>' is deprecated}}
     (void)cvt;
-
-    return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char32_t_char.depr_in_cxx20.verify.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char32_t_char.depr_in_cxx20.verify.cpp
index ebace3a4f647..1cf0ae3e244e 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char32_t_char.depr_in_cxx20.verify.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char32_t_char.depr_in_cxx20.verify.cpp
@@ -16,14 +16,10 @@
 #include <locale>
 
 #include "../with_public_dtor.hpp"
-#include "test_macros.h"
 
-int main(int, char **)
-{
+void f() {
     // Don't test for the exact type since the underlying type of
     // std::mbstate_t depends on implementation details.
     with_public_dtor<std::codecvt_byname<char32_t, char, std::mbstate_t>> cvt("", 0); // expected-warning-re {{'codecvt_byname<char32_t, char, {{.*}}>' is deprecated}}
     (void)cvt;
-
-    return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char16_t_char.depr_in_cxx20.verify.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char16_t_char.depr_in_cxx20.verify.cpp
index 54f57c6b0498..cc9c355854df 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char16_t_char.depr_in_cxx20.verify.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char16_t_char.depr_in_cxx20.verify.cpp
@@ -16,14 +16,10 @@
 #include <locale>
 
 #include "../with_public_dtor.hpp"
-#include "test_macros.h"
 
-int main(int, char **)
-{
+void f() {
     // Don't test for the exact type since the underlying type of
     // std::mbstate_t depends on implementation details.
     with_public_dtor<std::codecvt<char16_t, char, std::mbstate_t>> cvt("", 0); // expected-warning-re {{'codecvt<char16_t, char, {{.*}}>' is deprecated}}
     (void)cvt;
-
-    return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char32_t_char.depr_in_cxx20.verify.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char32_t_char.depr_in_cxx20.verify.cpp
index 9b7fdc5165b6..7cbfbd37591d 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char32_t_char.depr_in_cxx20.verify.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char32_t_char.depr_in_cxx20.verify.cpp
@@ -16,14 +16,10 @@
 #include <locale>
 
 #include "../with_public_dtor.hpp"
-#include "test_macros.h"
 
-int main(int, char **)
-{
+void f() {
     // Don't test for the exact type since the underlying type of
     // std::mbstate_t depends on implementation details.
     with_public_dtor<std::codecvt<char32_t, char, std::mbstate_t>> cvt("", 0); // expected-warning-re {{'codecvt<char32_t, char, {{.*}}>' is deprecated}}
     (void)cvt;
-
-    return 0;
 }

diff  --git a/libcxx/test/std/numerics/numbers/illformed.verify.cpp b/libcxx/test/std/numerics/numbers/illformed.verify.cpp
index 213f98cff952..8f19718bdeed 100644
--- a/libcxx/test/std/numerics/numbers/illformed.verify.cpp
+++ b/libcxx/test/std/numerics/numbers/illformed.verify.cpp
@@ -11,8 +11,7 @@
 #include <numbers>
 
 // Initializing the primary template is ill-formed.
-int log2e{std::numbers::log2e_v<
-    int>}; // expected-error-re at numbers:* {{{{(static_assert|static assertion)}} failed{{.*}}A program that instantiates a primary template of a mathematical constant variable template is ill-formed.}}
+int log2e{std::numbers::log2e_v<int>}; // expected-error-re at numbers:* {{{{(static_assert|static assertion)}} failed{{.*}}A program that instantiates a primary template of a mathematical constant variable template is ill-formed.}}
 int log10e{std::numbers::log10e_v<int>};
 int pi{std::numbers::pi_v<int>};
 int inv_pi{std::numbers::inv_pi_v<int>};
@@ -24,5 +23,3 @@ int sqrt3{std::numbers::sqrt3_v<int>};
 int inv_sqrt3{std::numbers::inv_sqrt3_v<int>};
 int egamma{std::numbers::egamma_v<int>};
 int phi{std::numbers::phi_v<int>};
-
-int main(int, char**) { return 0; }

diff  --git a/libcxx/test/std/numerics/rand/rand.req/rand.req.urng/uniform_random_bit_generator.compile.pass.cpp b/libcxx/test/std/numerics/rand/rand.req/rand.req.urng/uniform_random_bit_generator.compile.pass.cpp
index bfda9b79d56a..9f2fe28d4541 100644
--- a/libcxx/test/std/numerics/rand/rand.req/rand.req.urng/uniform_random_bit_generator.compile.pass.cpp
+++ b/libcxx/test/std/numerics/rand/rand.req/rand.req.urng/uniform_random_bit_generator.compile.pass.cpp
@@ -140,5 +140,3 @@ struct Works {
   static constexpr unsigned char max() { return 1; }
 };
 static_assert(std::uniform_random_bit_generator<Works>);
-
-int main(int, char**) { return 0; }

diff  --git a/libcxx/test/std/re/re.results/re.results.size/empty.verify.cpp b/libcxx/test/std/re/re.results/re.results.size/empty.verify.cpp
index 738ed88a5755..4087c24024ce 100644
--- a/libcxx/test/std/re/re.results/re.results.size/empty.verify.cpp
+++ b/libcxx/test/std/re/re.results/re.results.size/empty.verify.cpp
@@ -15,12 +15,7 @@
 
 #include <regex>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     std::match_results<const char*> c;
     c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/strings/basic.string/string.capacity/empty.verify.cpp b/libcxx/test/std/strings/basic.string/string.capacity/empty.verify.cpp
index 26a4daf6047b..8ba11ee406bc 100644
--- a/libcxx/test/std/strings/basic.string/string.capacity/empty.verify.cpp
+++ b/libcxx/test/std/strings/basic.string/string.capacity/empty.verify.cpp
@@ -16,21 +16,7 @@
 
 #include <string>
 
-#include "test_macros.h"
-
-TEST_CONSTEXPR_CXX20 bool test() {
+void f() {
   std::string c;
   c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-  return true;
-}
-
-int main(int, char**)
-{
-  test();
-#if TEST_STD_VER > 17
-  static_assert(test());
-#endif
-
-  return 0;
 }

diff  --git a/libcxx/test/std/strings/basic.string/string.capacity/reserve.deprecated_in_cxx20.verify.cpp b/libcxx/test/std/strings/basic.string/string.capacity/reserve.deprecated_in_cxx20.verify.cpp
index 1b8a5da96458..632f7fd0523a 100644
--- a/libcxx/test/std/strings/basic.string/string.capacity/reserve.deprecated_in_cxx20.verify.cpp
+++ b/libcxx/test/std/strings/basic.string/string.capacity/reserve.deprecated_in_cxx20.verify.cpp
@@ -14,9 +14,7 @@
 
 #include <string>
 
-int main(int, char**)
-{
+void f() {
     std::string s;
     s.reserve(); // expected-warning {{'reserve' is deprecated}}
-    return 0;
 }

diff  --git a/libcxx/test/std/strings/string.view/string.view.capacity/empty.verify.cpp b/libcxx/test/std/strings/string.view/string.view.capacity/empty.verify.cpp
index 9e6af24fdd5d..73e0af7cb5e9 100644
--- a/libcxx/test/std/strings/string.view/string.view.capacity/empty.verify.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.capacity/empty.verify.cpp
@@ -16,12 +16,7 @@
 
 #include <string_view>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     std::string_view c;
     c.empty();  // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/thread/futures/futures.async/async.verify.cpp b/libcxx/test/std/thread/futures/futures.async/async.verify.cpp
index 997d27a8ceac..e47ad82e7998 100644
--- a/libcxx/test/std/thread/futures/futures.async/async.verify.cpp
+++ b/libcxx/test/std/thread/futures/futures.async/async.verify.cpp
@@ -21,18 +21,10 @@
 
 
 #include <future>
-#include <atomic>
-#include <memory>
-#include <cassert>
-
-#include "test_macros.h"
 
 int foo (int x) { return x; }
 
-int main(int, char**)
-{
+void f() {
     std::async(                    foo, 3); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
     std::async(std::launch::async, foo, 3); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/thread/futures/futures.promise/copy_assign.verify.cpp b/libcxx/test/std/thread/futures/futures.promise/copy_assign.verify.cpp
index 96d7e572f2a0..84fa1c439cf6 100644
--- a/libcxx/test/std/thread/futures/futures.promise/copy_assign.verify.cpp
+++ b/libcxx/test/std/thread/futures/futures.promise/copy_assign.verify.cpp
@@ -16,10 +16,7 @@
 
 #include <future>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     {
         std::promise<int> p0, p;
         p = p0; // expected-error {{overload resolution selected deleted operator '='}}
@@ -32,6 +29,4 @@ int main(int, char**)
         std::promise<void> p0, p;
         p = p0; // expected-error {{overload resolution selected deleted operator '='}}
     }
-
-    return 0;
 }

diff  --git a/libcxx/test/std/thread/futures/futures.promise/copy_ctor.verify.cpp b/libcxx/test/std/thread/futures/futures.promise/copy_ctor.verify.cpp
index b4f3d7f452f6..437642ba7c58 100644
--- a/libcxx/test/std/thread/futures/futures.promise/copy_ctor.verify.cpp
+++ b/libcxx/test/std/thread/futures/futures.promise/copy_ctor.verify.cpp
@@ -16,10 +16,7 @@
 
 #include <future>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     {
         std::promise<int> p0;
         std::promise<int> p(p0); // expected-error {{call to deleted constructor of 'std::promise<int>'}}
@@ -32,6 +29,4 @@ int main(int, char**)
         std::promise<void> p0;
         std::promise<void> p(p0); // expected-error {{call to deleted constructor of 'std::promise<void>'}}
     }
-
-    return 0;
 }

diff  --git a/libcxx/test/std/thread/futures/futures.unique_future/copy_assign.verify.cpp b/libcxx/test/std/thread/futures/futures.unique_future/copy_assign.verify.cpp
index 284ccd86390a..cb7e8552175b 100644
--- a/libcxx/test/std/thread/futures/futures.unique_future/copy_assign.verify.cpp
+++ b/libcxx/test/std/thread/futures/futures.unique_future/copy_assign.verify.cpp
@@ -16,10 +16,7 @@
 
 #include <future>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     {
         std::future<int> f0, f;
         f = f0; // expected-error {{overload resolution selected deleted operator '='}}
@@ -32,6 +29,4 @@ int main(int, char**)
         std::future<void> f0, f;
         f = f0; // expected-error {{overload resolution selected deleted operator '='}}
     }
-
-    return 0;
 }

diff  --git a/libcxx/test/std/thread/futures/futures.unique_future/copy_ctor.verify.cpp b/libcxx/test/std/thread/futures/futures.unique_future/copy_ctor.verify.cpp
index 442489025b61..4ab51efbdfdc 100644
--- a/libcxx/test/std/thread/futures/futures.unique_future/copy_ctor.verify.cpp
+++ b/libcxx/test/std/thread/futures/futures.unique_future/copy_ctor.verify.cpp
@@ -16,10 +16,7 @@
 
 #include <future>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     {
         std::future<int> f0;
         std::future<int> f = f0; // expected-error {{call to deleted constructor of 'std::future<int>'}}
@@ -32,6 +29,4 @@ int main(int, char**)
         std::future<void> f0;
         std::future<void> f = f0; // expected-error {{call to deleted constructor of 'std::future<void>'}}
     }
-
-    return 0;
 }

diff  --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.verify.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.verify.cpp
index fd4d03e2c1c1..6bd5f8041f85 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.verify.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.verify.cpp
@@ -16,14 +16,10 @@
 // pointer allocate(size_type n);
 
 #include <scoped_allocator>
-#include <cassert>
 
 #include "allocators.h"
 
-int main(int, char**)
-{
+void f() {
     std::scoped_allocator_adaptor<A1<int>> a;
     a.allocate(10);  // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.verify.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.verify.cpp
index 6e60b6a3767a..05588dffd4a8 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.verify.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.verify.cpp
@@ -16,14 +16,10 @@
 // pointer allocate(size_type n, const_void_pointer hint);
 
 #include <scoped_allocator>
-#include <cassert>
 
 #include "allocators.h"
 
-int main(int, char**)
-{
+void f() {
     std::scoped_allocator_adaptor<A1<int>> a;
     a.allocate(10, (const void*)0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp
index a066c6af4998..cc825762affb 100644
--- a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp
+++ b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp
@@ -30,8 +30,7 @@
 struct TestType {};
 struct TestType2 {};
 
-int main(int, char**)
-{
+void f() {
     std::any a;
 
     // expected-error-re at any:* {{{{(static_assert|static assertion)}} failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
@@ -45,6 +44,4 @@ int main(int, char**)
 
     // expected-error-re at any:* {{{{(static_assert|static assertion)}} failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
     std::any_cast<TestType2 &&>(static_cast<std::any const&&>(a)); // expected-note {{requested here}}
-
-  return 0;
 }

diff  --git a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp
index a3b3b3b6734e..394ebca1d769 100644
--- a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp
+++ b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp
@@ -33,20 +33,19 @@
 
 #include <any>
 
-struct no_copy
-{
+struct no_copy {
     no_copy() {}
     no_copy(no_copy &&) {}
     no_copy(no_copy const &) = delete;
 };
 
 struct no_move {
-  no_move() {}
-  no_move(no_move&&) = delete;
-  no_move(no_move const&) {}
+    no_move() {}
+    no_move(no_move&&) = delete;
+    no_move(no_move const&) {}
 };
 
-int main(int, char**) {
+void f() {
     std::any a;
     // expected-error-re at any:* {{{{(static_assert|static assertion)}} failed{{.*}}ValueType is required to be an lvalue reference or a CopyConstructible type}}
     std::any_cast<no_copy>(static_cast<std::any&>(a)); // expected-note {{requested here}}
@@ -58,6 +57,4 @@ int main(int, char**) {
 
     // expected-error-re at any:* {{{{(static_assert|static assertion)}} failed{{.*}}ValueType is required to be an rvalue reference or a CopyConstructible type}}
     std::any_cast<no_move>(static_cast<std::any &&>(a));
-
-  return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.arguments/format.args/types.compile.pass.cpp b/libcxx/test/std/utilities/format/format.arguments/format.args/types.compile.pass.cpp
index 9ca1d31e6abd..4121d0b0e6b1 100644
--- a/libcxx/test/std/utilities/format/format.arguments/format.args/types.compile.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.arguments/format.args/types.compile.pass.cpp
@@ -26,6 +26,3 @@ static_assert(std::is_same_v<std::format_args,
 static_assert(std::is_same_v<std::wformat_args,
                              std::basic_format_args<std::wformat_context>>);
 #endif
-
-// Required for MSVC internal test runner compatibility.
-int main(int, char**) { return 0; }

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.verify.cpp b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.verify.cpp
index 74342c7d0fdb..c3f68206c1b3 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.verify.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.verify.cpp
@@ -12,8 +12,6 @@
 
 #include <format>
 
-#include "test_macros.h"
-
 constexpr bool test() {
   // [format.parse.ctx]/11
   // Remarks: Call expressions where id >= num_args_ are not
@@ -24,9 +22,7 @@ constexpr bool test() {
   return true;
 }
 
-int main(int, char**) {
+void f() {
   // expected-error-re at +1 {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
   static_assert(test());
-
-  return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.verify.cpp b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.verify.cpp
index f505a605c3e5..844856083817 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.verify.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.verify.cpp
@@ -12,8 +12,6 @@
 
 #include <format>
 
-#include "test_macros.h"
-
 constexpr bool test() {
   // [format.parse.ctx]/8
   // Let cur-arg-id be the value of next_arg_id_ prior to this call. Call
@@ -25,9 +23,7 @@ constexpr bool test() {
   return true;
 }
 
-int main(int, char**) {
+void f() {
   // expected-error-re at +1 {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
   static_assert(test());
-
-  return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/types.compile.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/types.compile.pass.cpp
index eaa18a476aeb..f224daee70a5 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/types.compile.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/types.compile.pass.cpp
@@ -62,6 +62,3 @@ static_assert(std::is_same_v<std::format_parse_context,
 static_assert(std::is_same_v<std::wformat_parse_context,
                              std::basic_format_parse_context<wchar_t> >);
 #endif
-
-// Required for MSVC internal test runner compatibility.
-int main(int, char**) { return 0; }

diff  --git a/libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp b/libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp
index f7d24998e09b..ac9c97d039ba 100644
--- a/libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp
@@ -15,8 +15,6 @@
 
 #include <functional>
 
-#include "test_macros.h"
-
 constexpr int pass(const int n) { return n; }
 
 int simple(int n) { return n; }
@@ -34,8 +32,7 @@ struct NotMoveConst
 
 void testNotMoveConst(NotMoveConst) { }
 
-int main(int, char**)
-{
+void f() {
     int n = 1;
     const int c = 1;
 
@@ -45,6 +42,4 @@ int main(int, char**)
     auto d = std::bind_front(do_nothing, n); // expected-error {{no matching function for call to 'bind_front'}}
 
     auto t = std::bind_front(testNotMoveConst, NotMoveConst(0)); // expected-error {{no matching function for call to 'bind_front'}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.verify.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.verify.cpp
index 49c8284b87c3..b5d4a729ceda 100644
--- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.verify.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.verify.cpp
@@ -17,12 +17,8 @@
 // This signature was removed in C++17
 
 #include <functional>
-#include <cassert>
+#include <memory>
 
-#include "min_allocator.h"
-
-int main(int, char**)
-{
+void f() {
     std::function<int(int)> f(std::allocator_arg, std::allocator<int>()); // expected-error {{no matching constructor for initialization of}}
-    return 0;
 }

diff  --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.verify.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.verify.cpp
index 2353b51a2d9f..88f81492c58f 100644
--- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.verify.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.verify.cpp
@@ -17,15 +17,10 @@
 // This signature was removed in C++17
 
 #include <functional>
-#include <cassert>
 #include <memory>
 
-#include "test_macros.h"
-
 void foo(int) {}
 
-int main(int, char**)
-{
+void f() {
     std::function<void(int)> f(std::allocator_arg, std::allocator<int>(), foo); // expected-error {{no matching constructor for initialization of}}
-    return 0;
 }

diff  --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.verify.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.verify.cpp
index 4263eeef67de..acb42fc169ab 100644
--- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.verify.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.verify.cpp
@@ -17,15 +17,10 @@
 // This signature was removed in C++17
 
 #include <functional>
-#include <cassert>
 #include <memory>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     typedef std::function<void(int)> F;
     F f1;
     F f2(std::allocator_arg, std::allocator<int>(), f1); // expected-error {{no matching constructor for initialization of}}
-    return 0;
 }

diff  --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.verify.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.verify.cpp
index 6e9a6c44137f..d457e21377a6 100644
--- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.verify.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.verify.cpp
@@ -17,12 +17,8 @@
 // This signature was removed in C++17
 
 #include <functional>
-#include <cassert>
+#include <memory>
 
-#include "min_allocator.h"
-
-int main(int, char**)
-{
+void f() {
     std::function<int(int)> f(std::allocator_arg, std::allocator<int>(), nullptr); // expected-error {{no matching constructor for initialization of}}
-    return 0;
 }

diff  --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.verify.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.verify.cpp
index b04b958f86a2..5fd6c96ce66e 100644
--- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.verify.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.verify.cpp
@@ -16,13 +16,10 @@
 //
 // This signature was removed in C++17
 
-#include <cassert>
 #include <functional>
 #include <memory>
 #include <utility>
 
-#include "test_macros.h"
-
 class A
 {
     int data_[10];
@@ -52,9 +49,7 @@ int A::count = 0;
 
 int g(int) { return 0; }
 
-int main(int, char**)
-{
+void f() {
     std::function<int(int)> f = A();
     std::function<int(int)> f2(std::allocator_arg, std::allocator<A>(), std::move(f)); // expected-error {{no matching constructor for initialization of}}
-    return 0;
 }

diff  --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/deduct_F.verify.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/deduct_F.verify.cpp
index cc20a01d2448..520e5f055a71 100644
--- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/deduct_F.verify.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/deduct_F.verify.cpp
@@ -19,15 +19,13 @@
 // Make sure we stick to the specification.
 
 #include <functional>
-#include <type_traits>
 
 struct R { };
 struct f0 { R operator()() && { return {}; } };
 struct f1 { R operator()(int, ...) { return {}; } };
 
-int main(int, char**) {
+void f() {
     std::function f = f0{}; // expected-error{{no viable constructor or deduction guide for deduction of template arguments of 'function'}}
     std::function g = f1{}; // expected-error{{no viable constructor or deduction guide for deduction of template arguments of 'function'}}
     std::function h = nullptr; // expected-error{{no viable constructor or deduction guide for deduction of template arguments of 'function'}}
-    return 0;
 }

diff  --git a/libcxx/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.verify.cpp b/libcxx/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.verify.cpp
index 1f6e153021e8..5e7947f318f7 100644
--- a/libcxx/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.verify.cpp
+++ b/libcxx/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.verify.cpp
@@ -16,17 +16,13 @@
 
 #include <functional>
 
-#include "test_macros.h"
-
 struct Predicate {
     typedef int first_argument_type;
     typedef int second_argument_type;
     bool operator()(first_argument_type, second_argument_type) const { return true; }
 };
 
-int main(int, char**) {
+void test() {
     std::binary_negate<Predicate> f((Predicate())); // expected-warning {{'binary_negate<Predicate>' is deprecated}}
     (void)f;
-
-    return 0;
 }

diff  --git a/libcxx/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.verify.cpp b/libcxx/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.verify.cpp
index e807a1ec6d4c..4758a17f2632 100644
--- a/libcxx/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.verify.cpp
+++ b/libcxx/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.verify.cpp
@@ -16,15 +16,11 @@
 
 #include <functional>
 
-#include "test_macros.h"
-
 struct Predicate {
     typedef int argument_type;
     bool operator()(argument_type) const { return true; }
 };
 
-int main(int, char**) {
+void f() {
     std::not1(Predicate()); // expected-warning {{'not1<Predicate>' is deprecated}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.verify.cpp b/libcxx/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.verify.cpp
index 7e079f5d35f8..e6e1637f7e82 100644
--- a/libcxx/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.verify.cpp
+++ b/libcxx/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.verify.cpp
@@ -16,16 +16,12 @@
 
 #include <functional>
 
-#include "test_macros.h"
-
 struct Predicate {
     typedef int first_argument_type;
     typedef int second_argument_type;
     bool operator()(first_argument_type, second_argument_type) const { return true; }
 };
 
-int main(int, char**) {
+void f() {
     std::not2(Predicate()); // expected-warning {{'not2<Predicate>' is deprecated}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.verify.cpp b/libcxx/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.verify.cpp
index 1cf16297c287..70c871fd47a9 100644
--- a/libcxx/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.verify.cpp
+++ b/libcxx/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.verify.cpp
@@ -16,16 +16,12 @@
 
 #include <functional>
 
-#include "test_macros.h"
-
 struct Predicate {
     typedef int argument_type;
     bool operator()(argument_type) const { return true; }
 };
 
-int main(int, char**) {
+void test() {
     std::unary_negate<Predicate> f((Predicate())); // expected-warning {{'unary_negate<Predicate>' is deprecated}}
     (void)f;
-
-  return 0;
 }

diff  --git a/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.verify.cpp b/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.verify.cpp
index 7e3c41ced847..adb4d697e132 100644
--- a/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.verify.cpp
+++ b/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.verify.cpp
@@ -17,36 +17,18 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 
-#include <cassert>
 #include <cstddef>
-#include <cstdint>
 #include <memory>
 
-#include "test_macros.h"
-
 template <class T>
-struct A
-{
+struct A {
     typedef T value_type;
-
-    value_type* allocate(std::size_t n)
-    {
-        assert(n == 12);
-        return reinterpret_cast<value_type*>(static_cast<std::uintptr_t>(0xEEADBEEF));
-    }
-    value_type* allocate(std::size_t n, const void* p)
-    {
-        assert(n == 11);
-        assert(p == 0);
-        return reinterpret_cast<value_type*>(static_cast<std::uintptr_t>(0xFEADBEEF));
-    }
+    value_type* allocate(std::size_t n);
+    value_type* allocate(std::size_t n, const void* p);
 };
 
-int main(int, char**)
-{
+void f() {
     A<int> a;
     std::allocator_traits<A<int> >::allocate(a, 10);          // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
     std::allocator_traits<A<int> >::allocate(a, 10, nullptr); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp
index 717ba0d3b433..71db96807f55 100644
--- a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp
+++ b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp
@@ -13,7 +13,6 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 
-#include <cassert>
 #include <cstddef>
 #include <memory>
 
@@ -33,9 +32,7 @@ constexpr bool test()
     return true;
 }
 
-int main(int, char**)
-{
+void f() {
     static_assert(test<double>()); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
     LIBCPP_STATIC_ASSERT(test<const double>()); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
-    return 0;
 }

diff  --git a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.verify.cpp b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.verify.cpp
index c19710a1596e..b2b6f51e9824 100644
--- a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.verify.cpp
+++ b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.verify.cpp
@@ -14,14 +14,8 @@
 // T* allocate(size_t n);
 
 #include <memory>
-#include <cassert>
 
-#include "test_macros.h"
-
-int main(int, char**)
-{
+void f() {
     std::allocator<int> a;
     a.allocate(3); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
-
-    return 0;
 }

diff  --git a/libcxx/test/std/utilities/memory/default.allocator/allocator_types.deprecated_in_cxx17.verify.cpp b/libcxx/test/std/utilities/memory/default.allocator/allocator_types.deprecated_in_cxx17.verify.cpp
index 901f04730ee8..917492929ecc 100644
--- a/libcxx/test/std/utilities/memory/default.allocator/allocator_types.deprecated_in_cxx17.verify.cpp
+++ b/libcxx/test/std/utilities/memory/default.allocator/allocator_types.deprecated_in_cxx17.verify.cpp
@@ -27,7 +27,7 @@
 
 #include <memory>
 
-int main(int, char**) {
+void f() {
     {
         typedef std::allocator<char>::pointer Pointer;                  // expected-warning {{'pointer' is deprecated}}
         typedef std::allocator<char>::const_pointer ConstPointer;       // expected-warning {{'const_pointer' is deprecated}}
@@ -48,5 +48,4 @@ int main(int, char**) {
         // reference and const_reference are not provided by std::allocator<void>
         typedef std::allocator<void>::rebind<int>::other Rebind;        // expected-warning {{'rebind<int>' is deprecated}}
     }
-    return 0;
 }

diff  --git a/libcxx/test/std/utilities/memory/default.allocator/allocator_types.removed_in_cxx20.verify.cpp b/libcxx/test/std/utilities/memory/default.allocator/allocator_types.removed_in_cxx20.verify.cpp
index 1d91a022867d..2fb7a60c9a88 100644
--- a/libcxx/test/std/utilities/memory/default.allocator/allocator_types.removed_in_cxx20.verify.cpp
+++ b/libcxx/test/std/utilities/memory/default.allocator/allocator_types.removed_in_cxx20.verify.cpp
@@ -26,7 +26,6 @@
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 
 #include <memory>
-#include "test_macros.h"
 
 template <typename T>
 void check()
@@ -38,10 +37,8 @@ void check()
     typedef typename std::allocator<T>::template rebind<int>::other ARO; // expected-error 3 {{no member named 'rebind'}}
 }
 
-int main(int, char**)
-{
+void f() {
     check<char>();
     check<char const>();
     check<void>();
-    return 0;
 }

diff  --git a/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/common_reference.compile.pass.cpp b/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/common_reference.compile.pass.cpp
index 643d5301baae..9332865eaa24 100644
--- a/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/common_reference.compile.pass.cpp
+++ b/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/common_reference.compile.pass.cpp
@@ -217,5 +217,3 @@ static_assert(!has_type<std::common_reference<std::pair<int, const X2>, std::pai
 static_assert(!has_type<std::common_reference<std::pair<int, X2>, std::pair<float, Z2>>>);
 static_assert(!has_type<std::common_reference<std::pair<int, X2>, int, X2>>);
 #endif
-
-int main(int, char**) { return 0; }

diff  --git a/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.verify.cpp b/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.verify.cpp
index d125eb02f33f..46506e562262 100644
--- a/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.verify.cpp
+++ b/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.verify.cpp
@@ -13,13 +13,12 @@
 // test op*()
 
 #include <memory>
-#include <cassert>
 
-int main(int, char**) {
+#include "test_macros.h"
+
+void f() {
   std::unique_ptr<int[]> p(new int(3));
   const std::unique_ptr<int[]>& cp = p;
   TEST_IGNORE_NODISCARD(*p);  // expected-error-re {{indirection requires pointer operand ('std::unique_ptr<int{{[ ]*}}[]>' invalid)}}
   TEST_IGNORE_NODISCARD(*cp); // expected-error-re {{indirection requires pointer operand ('const std::unique_ptr<int{{[ ]*}}[]>' invalid)}}
-
-  return 0;
 }

diff  --git a/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.verify.cpp b/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.verify.cpp
index 3d1a5e066a7a..5361c1f05515 100644
--- a/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.verify.cpp
+++ b/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.verify.cpp
@@ -13,13 +13,12 @@
 // test op->()
 
 #include <memory>
-#include <cassert>
 
 struct V {
   int member;
 };
 
-int main(int, char**) {
+void f() {
   std::unique_ptr<V[]> p;
   std::unique_ptr<V[]> const& cp = p;
 
@@ -28,6 +27,4 @@ int main(int, char**) {
 
   cp->member; // expected-error-re {{member reference type 'const std::unique_ptr<V{{[ ]*}}[]>' is not a pointer}}
               // expected-error at -1 {{no member named 'member'}}
-
-  return 0;
 }

diff  --git a/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.verify.cpp b/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.verify.cpp
index b1b2881d888f..9236d6e284b5 100644
--- a/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.verify.cpp
+++ b/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.verify.cpp
@@ -16,9 +16,7 @@
 
 struct S {};
 
-int main(int, char**) {
+void f() {
   std::to_underlying(125); // expected-error {{no matching function for call}}
   std::to_underlying(S{}); // expected-error {{no matching function for call}}
-
-  return 0;
 }

diff  --git a/libcxx/test/support/test.support/test_macros_header.no_exceptions.verify.cpp b/libcxx/test/support/test.support/test_macros_header.no_exceptions.verify.cpp
index cc156e251511..efdf1c02dc67 100644
--- a/libcxx/test/support/test.support/test_macros_header.no_exceptions.verify.cpp
+++ b/libcxx/test/support/test.support/test_macros_header.no_exceptions.verify.cpp
@@ -17,7 +17,6 @@
 #  error "TEST_HAS_NO_EXCEPTIONS should be defined"
 #endif
 
-int main(int, char**) {
+void f() {
     try { (void)0; } catch (...) { } // expected-error {{exceptions disabled}}
-    return 0;
 }

diff  --git a/libcxx/test/support/test.support/test_macros_header.no_rtti.verify.cpp b/libcxx/test/support/test.support/test_macros_header.no_rtti.verify.cpp
index a7f35577c6be..8790c73416e0 100644
--- a/libcxx/test/support/test.support/test_macros_header.no_rtti.verify.cpp
+++ b/libcxx/test/support/test.support/test_macros_header.no_rtti.verify.cpp
@@ -20,8 +20,7 @@
 struct A { virtual ~A() { } };
 struct B : A { };
 
-int main(int, char**) {
+void f() {
     A* ptr = new B;
     (void)dynamic_cast<B*>(ptr); // expected-error{{use of dynamic_cast requires -frtti}}
-    return 0;
 }


        


More information about the libcxx-commits mailing list