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

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

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

GitOrigin-RevId: 504bc07d1afc7bad7b980a977141696ec8298e7e
diff --git a/test/alignment.pass.cpp b/test/alignment.compile.pass.cpp
similarity index 97%
rename from test/alignment.pass.cpp
rename to test/alignment.compile.pass.cpp
index b0da7f1..4606dc5 100644
--- a/test/alignment.pass.cpp
+++ b/test/alignment.compile.pass.cpp
@@ -22,7 +22,3 @@
 static_assert(alignof(_Unwind_Exception) == alignof(MaxAligned),
               "_Unwind_Exception must be maximally aligned");
 #endif
-
-int main()
-{
-}
diff --git a/test/frameheadercache_test.pass.cpp b/test/frameheadercache_test.pass.cpp
index 7f14830..9abff5e 100644
--- a/test/frameheadercache_test.pass.cpp
+++ b/test/frameheadercache_test.pass.cpp
@@ -19,7 +19,7 @@
 
 using namespace libunwind;
 
-int main() {
+int main(int, char**) {
   FrameHeaderCache FHC;
   struct dl_phdr_info PInfo;
   memset(&PInfo, 0, sizeof(PInfo));
@@ -68,5 +68,5 @@
 }
 
 #else
-int main() { return 0;}
+int main(int, char**) { return 0;}
 #endif
diff --git a/test/libunwind_01.pass.cpp b/test/libunwind_01.pass.cpp
index db5d53d..191684d 100644
--- a/test/libunwind_01.pass.cpp
+++ b/test/libunwind_01.pass.cpp
@@ -55,9 +55,10 @@
     abort();
 }
 
-int main() {
+int main(int, char**) {
   test1(1);
   test2(1, 2);
   test3(1, 2, 3);
   test_no_info();
+  return 0;
 }
diff --git a/test/libunwind_02.pass.cpp b/test/libunwind_02.pass.cpp
index a0efd1d..b188fad 100644
--- a/test/libunwind_02.pass.cpp
+++ b/test/libunwind_02.pass.cpp
@@ -32,7 +32,8 @@
   }
 }
 
-int main() {
+int main(int, char**) {
   int total = test(50);
   assert(total == 1275);
+  return 0;
 }
diff --git a/test/signal_frame.pass.cpp b/test/signal_frame.pass.cpp
index a899461..28f8d99 100644
--- a/test/signal_frame.pass.cpp
+++ b/test/signal_frame.pass.cpp
@@ -25,7 +25,7 @@
   assert(unw_is_signal_frame(&cursor));
 }
 
-int main() {
+int main(int, char**) {
   test();
   return 0;
 }
diff --git a/test/signal_unwind.pass.cpp b/test/signal_unwind.pass.cpp
index 5955c1b..25ff0bb 100644
--- a/test/signal_unwind.pass.cpp
+++ b/test/signal_unwind.pass.cpp
@@ -38,7 +38,7 @@
   _Exit(-1);
 }
 
-int main() {
+int main(int, char**) {
   signal(SIGUSR1, signal_handler);
   kill(getpid(), SIGUSR1);
   return -2;
diff --git a/test/unw_getcontext.pass.cpp b/test/unw_getcontext.pass.cpp
index b012706..a1f2bae 100644
--- a/test/unw_getcontext.pass.cpp
+++ b/test/unw_getcontext.pass.cpp
@@ -1,8 +1,9 @@
 #include <assert.h>
 #include <libunwind.h>
 
-int main() {
+int main(int, char**) {
   unw_context_t context;
   int ret = unw_getcontext(&context);
   assert(ret == UNW_ESUCCESS);
+  return 0;
 }
diff --git a/test/unwind_leaffunction.pass.cpp b/test/unwind_leaffunction.pass.cpp
index 8e4fcbe..2b08a16 100644
--- a/test/unwind_leaffunction.pass.cpp
+++ b/test/unwind_leaffunction.pass.cpp
@@ -44,7 +44,7 @@
   *faultyPointer = 0;
 }
 
-int main() {
+int main(int, char**) {
   signal(SIGSEGV, signal_handler);
   crashing_leaf_func();
   return -2;