[runtimes][NFC] Consistently declare main() functions in tests (#162548) In the libc++ test suite, we consistently declare main() functions with full parameters and explicitly return from the function. This helps code that compiles the tests with -ffreestanding, where main() is not a special function (with an implicit return and special mangling). This patch fixes a few stray declarations, including in libunwind and libc++abi. NOKEYCHECK=True GitOrigin-RevId: 4f80c064eb2933c00c0ba9b7826aa3631cf3b5c2
diff --git a/test/forced_unwind4.pass.cpp b/test/forced_unwind4.pass.cpp index 15efca8..fbc8128 100644 --- a/test/forced_unwind4.pass.cpp +++ b/test/forced_unwind4.pass.cpp
@@ -17,9 +17,7 @@ // Android/Bionic does not support pthread_cancel. #ifdef __BIONIC__ -int main() { - return 0; -} +int main(int, char**) { return 0; } #else #include <chrono> @@ -45,7 +43,7 @@ return (void*)1; } -int main() { +int main(int, char**) { pthread_t child_thread; std::unique_lock<std::mutex> lk(cv_m); pthread_create(&child_thread, 0, test, (void*)0);
diff --git a/test/native/AArch64/ra_sign_state.pass.cpp b/test/native/AArch64/ra_sign_state.pass.cpp index 35c05fc..dec7aca 100644 --- a/test/native/AArch64/ra_sign_state.pass.cpp +++ b/test/native/AArch64/ra_sign_state.pass.cpp
@@ -53,7 +53,7 @@ } } -int main() { +int main(int, char**) { try { bazz(); } catch (int i) {