diff options
| author | Louis Dionne <ldionne.2@gmail.com> | 2025-10-09 09:00:20 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-09 09:00:20 -0400 |
| commit | 4f80c064eb2933c00c0ba9b7826aa3631cf3b5c2 (patch) | |
| tree | 680764636a3c1fdf8dadb430cec458d5c25499c7 /libcxxabi | |
| parent | 5841319aca0f2596cc00ab83d54ec07c9b70da3c (diff) | |
[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.
Diffstat (limited to 'libcxxabi')
| -rw-r--r-- | libcxxabi/test/forced_unwind4.pass.cpp | 6 | ||||
| -rw-r--r-- | libcxxabi/test/native/AArch64/ra_sign_state.pass.cpp | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/libcxxabi/test/forced_unwind4.pass.cpp b/libcxxabi/test/forced_unwind4.pass.cpp index 15efca8d9316..fbc8128af907 100644 --- a/libcxxabi/test/forced_unwind4.pass.cpp +++ b/libcxxabi/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 @@ static void* test(void* arg) { 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/libcxxabi/test/native/AArch64/ra_sign_state.pass.cpp b/libcxxabi/test/native/AArch64/ra_sign_state.pass.cpp index 35c05fc40efd..dec7acab7c21 100644 --- a/libcxxabi/test/native/AArch64/ra_sign_state.pass.cpp +++ b/libcxxabi/test/native/AArch64/ra_sign_state.pass.cpp @@ -53,7 +53,7 @@ void bazz() { } } -int main() { +int main(int, char**) { try { bazz(); } catch (int i) { |
