This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch, Testsuite, ARM] Improve test gcc.target/arm/handler-align.c


This test checks that the stack pointer is handled correctly in
prologue/epilogue of Cortex-M interrupt handlers. An interrupt handler may
be called when stack is not double-word aligned. The prologue of the
interrupt handler aligns the stack pointer and the epilogue restores the
original stack pointer.

However, in this test, the stack is always double-word aligned when the
handler function foo is called. As a result, the test is not very effective,
for example it passes even if the epilogue does not restore the stack
pointer. This patch forces the stack pointer to be not double-word aligned
on the call to foo.

Tested on qemu -cpu cortex-m3.

Ok for trunk?

Thanks,
Greta

ChangeLog:

gcc/testsuite

2012-06-18  Greta Yorsh  <Greta.Yorsh@arm.com>

        * gcc.target/arm/handler-align.c (main): Force the stack pointer
        to be not double-word aligned on the call to the interrupt handler.

Attachment: test-handler-align.v1.patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]