With -O2 and above, the compiler performs a sibling call optimization as
main () and it's callee have compatible stack usage. As for generating
stack traces though, there is nothing that any stack trace or unwind
format can do here. Use -fno-optimize-sibling-calls to at least ensure
the testcase checkes for the complete stack trace.
ChangeLog:
* libsframe/testsuite/libsframe.unwind/backtrace-fp-attr-1.lk:
Use -fno-optimize-sibling-calls.
* libsframe/testsuite/libsframe.unwind/backtrace-fp-attr-2.lk:
Likewise.
# source: backtrace-fp-attr-1.c
-# cflags: -fno-omit-frame-pointer
+# cflags: -fno-omit-frame-pointer -fno-optimize-sibling-calls
# link: on
PASS: backtrace with omit-frame-pointer attr
# source: backtrace-fp-attr-2.c
-# cflags: -fomit-frame-pointer
+# cflags: -fomit-frame-pointer -fno-optimize-sibling-calls
# link: on
PASS: backtrace with no-omit-frame-pointer attr