diff options
author | carlos <carlos@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-23 20:36:57 +0000 |
---|---|---|
committer | carlos <carlos@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-23 20:36:57 +0000 |
commit | 658e203c9c9fb27b576911037bd432523335a93a (patch) | |
tree | fabe76f974542d0458d609ec4222651293549585 /gcc/testsuite | |
parent | 0ac9b10f0d143d299c2979bbc09038bf3dc6c9d8 (diff) | |
download | gcc-658e203c9c9fb27b576911037bd432523335a93a.tar.gz |
gcc/
2008-05-23 Paul Brook <paul@codesourcery.com>
Carlos O'Donell <carlos@codesourcery.com>
* doc/extend.texi: Clarify use of __attribute__((naked)).
* doc/tm.texi: Document TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS.
* target.h (gcc_target): Add allocate_stack_slots_for_args.
* function.c (use_register_for_decl): Use
targetm.calls.allocate_stack_slots_for_args.
* target-def.h (TARGET_CALLS): Add
TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS.
* config/arm/arm.c (arm_allocate_stack_slots_for_args):
New function.
(TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Define.
gcc/testsuite/
2008-05-23 Paul Brook <paul@codesourcery.com>
Carlos O'Donell <carlos@codesourcery.com>
* gcc.target/arm/naked-1.c: New test.
* gcc.target/arm/naked-2.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135831 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/arm/naked-1.c | 13 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/arm/naked-2.c | 12 |
3 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d18afd8e6aa..1c457cc7fa3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2008-05-23 Paul Brook <paul@codesourcery.com> + Carlos O'Donell <carlos@codesourcery.com> + + * gcc.target/arm/naked-1.c: New test. + * gcc.target/arm/naked-2.c: New test. + 2008-05-23 Tobias Burnus <burnus@net-b.de> PR fortran/36314 diff --git a/gcc/testsuite/gcc.target/arm/naked-1.c b/gcc/testsuite/gcc.target/arm/naked-1.c new file mode 100644 index 00000000000..8f9ff711a5e --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/naked-1.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ +/* Check that function arguments aren't assigned and copied to stack slots + in naked functions. This ususally happens at -O0 (presumably for + better debugging), but is highly undesirable if we haven't created + a stack frame. */ +void __attribute__((naked)) +foo(int n) +{ + __asm__ volatile ("frob r0\n"); +} +/* { dg-final { scan-assembler "\tfrob r0" } } */ +/* { dg-final { scan-assembler-not "\tstr" } } */ diff --git a/gcc/testsuite/gcc.target/arm/naked-2.c b/gcc/testsuite/gcc.target/arm/naked-2.c new file mode 100644 index 00000000000..92e7db4447d --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/naked-2.c @@ -0,0 +1,12 @@ +/* Verify that __attribute__((naked)) produces a naked function + that does not use bx to return. Naked functions could be used + to implement interrupt routines and must not return using bx. */ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ +/* Use more arguments than we have argument registers. */ +int __attribute__((naked)) foo(int a, int b, int c, int d, int e, int f) +{ + __asm__ volatile ("@ naked"); +} +/* { dg-final { scan-assembler "\t@ naked" } } */ +/* { dg-final { scan-assembler-not "\tbx\tlr" } } */ |