[libc++] Move swap test to a .compile.pass.cpp (#143167)

diff --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.compile.pass.cpp
similarity index 98%
rename from libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
rename to libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.compile.pass.cpp
index b83ec3c..b50e675 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.compile.pass.cpp
@@ -52,7 +52,7 @@
   typedef std::true_type is_always_equal;
 };
 
-int main(int, char**) {
+void f() {
   {
     typedef std::forward_list<MoveOnly> C;
     static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
@@ -83,6 +83,4 @@
     static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
   }
 #endif
-
-  return 0;
 }