llvm-project/libunwind/test
Alex Richardson 8df257a6d0 [libunwind] Ensure test/libunwind_01.pass is not completely inlined
By adding noinline and calling fprintf before returning we ensure that
every function will have a distinct call frame and that the return address
will always be saved instead of saving the target in main as the result.

Before this change all backtraces were always backtrace -> main -> _start,
i.e. always exactly three entries. This happenend because all calls were
inlined in main() and the test just happenend to pass because there is at
least _start before main.

I found this while fixing some bugs in libunwind for CHERI and noticed that
the test was passing even though the code was completely broken.

Obtained from: https://github.com/CTSRD-CHERI/llvm-project

Reviewed By: #libunwind, ldionne, MaskRay

Differential Revision: https://reviews.llvm.org/D126611
2022-06-20 09:05:49 +00:00
..
configs [libunwind][ci][AIX] Add libunwind to buildbot CI 2022-06-02 09:03:10 -04:00
libunwind [libc++abi] Change LIBCXXABI_NO_TIMER to LIBCXXABI_USE_TIMER 2021-10-13 08:02:31 -04:00
CMakeLists.txt [libunwind] Introduce a cmake-bridge.cfg.in file to reduce test config duplication 2022-05-20 09:36:29 -04:00
alignment.compile.pass.cpp [runtimes] Use int main(int, char**) consistently in tests 2020-10-08 14:28:13 -04:00
bad_unwind_info.pass.cpp [libunwind] Use process_vm_readv to avoid potential segfaults 2022-05-26 09:12:51 -07:00
floatregister.pass.cpp [libunwind] Support cfi_undefined and cfi_register for float registers. 2021-09-27 12:04:02 +02:00
forceunwind.pass.cpp [libc++] Add a CI job running MSAN 2022-03-31 09:31:22 -04:00
frameheadercache_test.pass.cpp [libunwind] Add missing licenses in test files 2022-04-03 08:55:57 -04:00
libunwind_01.pass.cpp [libunwind] Ensure test/libunwind_01.pass is not completely inlined 2022-06-20 09:05:49 +00:00
libunwind_02.pass.cpp [libunwind] Add missing licenses in test files 2022-04-03 08:55:57 -04:00
lit.cfg.py [libunwind] Allow specifying custom Lit config files 2020-06-25 12:15:15 -04:00
lit.site.cfg.in [runtimes] Officially deprecate the legacy testing configuration system 2022-05-27 13:15:48 -04:00
remember_state_leak.pass.sh.s [libunwind] Add missing licenses in test files 2022-04-03 08:55:57 -04:00
signal_frame.pass.cpp [libunwind] Tidy-up the testing configuration for libunwind 2022-05-26 15:29:39 -04:00
signal_unwind.pass.cpp [libunwind][SystemZ] Unwind out of signal handlers 2022-05-04 10:43:11 +02:00
unw_getcontext.pass.cpp [libunwind] Add missing licenses in test files 2022-04-03 08:55:57 -04:00
unwind_leaffunction.pass.cpp [libunwind][SystemZ] Unwind out of signal handlers 2022-05-04 10:43:11 +02:00