Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Dionne <ldionne@apple.com>2020-10-08 20:36:33 +0300
committerLouis Dionne <ldionne@apple.com>2020-10-08 21:28:13 +0300
commit504bc07d1afc7bad7b980a977141696ec8298e7e (patch)
tree2da2e091f10cb4a8bd4ad9e5abd035256e6bbde3 /libunwind/test/unw_getcontext.pass.cpp
parent2b0c5d76a604c8d8b468e1ab6c36f3f495c80127 (diff)
[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.
Diffstat (limited to 'libunwind/test/unw_getcontext.pass.cpp')
-rw-r--r--libunwind/test/unw_getcontext.pass.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libunwind/test/unw_getcontext.pass.cpp b/libunwind/test/unw_getcontext.pass.cpp
index b012706a0bf9..a1f2baee12b4 100644
--- a/libunwind/test/unw_getcontext.pass.cpp
+++ b/libunwind/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;
}