]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[test] Check for correct -mrtd assumption on libgcc arithmetic functions
authorMichael Brown <mcb30@ipxe.org>
Sat, 26 Apr 2014 15:00:26 +0000 (16:00 +0100)
committerMichael Brown <mcb30@ipxe.org>
Sat, 26 Apr 2014 15:00:26 +0000 (16:00 +0100)
commit9e8c48deea90a601fdd45e8d7428d4eceb7e6a39
tree0f564bc7431296e7650a5573cdd5a33792a68cb6
parent082cedb3c3cdc5fd5eb0c614b81a1ff2ff9499be
[test] Check for correct -mrtd assumption on libgcc arithmetic functions

As observed in commit 082cedb ("[build] Fix __libgcc attribute for
recent gcc versions"), recent versions of gcc have changed the
semantics of -mrtd as applied to the implicit arithmetic functions.

It is possible for tests to succeed even if our assumptions about
gcc's interpretation of -mrtd are incorrect.  In particular, if gcc
chooses to utilise a frame pointer in the calling function, then it
can tolerate a temporarily incorrect stack pointer (since the stack
pointer will shortly afterwards be restored from the frame pointer
anyway).

Add tests designed specifically to check that our implementations of
the implicit arithmetic functions manipulate the stack pointer as
expected by gcc.

The effect of these tests can be observed by temporarily reverting
commit 082cedb ("[build] Fix __libgcc attribute for recent gcc
versions"): without this fix in place, the tests will fail on gcc 4.7
and later.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/tests/math_test.c