re PR target/53513 ([SH] Add support for fpchg insn and improve fenv support)

gcc/testsuite/
	PR target/53513
	* gcc.target/sh/attr-isr-nosave_low_regs.c: Fix matching of expected
	register push/pop sequences.
	* gcc.target/sh/attr-isr.c: Likewise.
	* gcc.target/sh/attr-isr-trapa.c: Likewise.
	* gcc.target/sh/pragma-isr-nosave_low_regs.c: Likewise.
	* gcc.target/sh/pragma-isr-trapa.c: Likewise.
	* gcc.target/sh/pragma-isr-trapa2.c: Likewise.

From-SVN: r218707
This commit is contained in:
Oleg Endo 2014-12-13 13:17:55 +00:00
parent 42948a4343
commit d64474d27f
7 changed files with 34 additions and 32 deletions

View File

@ -1,3 +1,14 @@
2014-12-13 Oleg Endo <olegendo@gcc.gnu.org>
PR target/53513
* gcc.target/sh/attr-isr-nosave_low_regs.c: Fix matching of expected
register push/pop sequences.
* gcc.target/sh/attr-isr.c: Likewise.
* gcc.target/sh/attr-isr-trapa.c: Likewise.
* gcc.target/sh/pragma-isr-nosave_low_regs.c: Likewise.
* gcc.target/sh/pragma-isr-trapa.c: Likewise.
* gcc.target/sh/pragma-isr-trapa2.c: Likewise.
2014-12-13 Oleg Endo <olegendo@gcc.gnu.org>
* gcc.target/sh/sp-switch.c: Match zero or more underscores in

View File

@ -1,15 +1,14 @@
/* A call will clobber all call-saved registers.
If #pragma nosave_low_regs is specified, do not save/restore r0..r7.
(On SH3* and SH4* r0..r7 are banked)
One of these registers will also do fine to hold the function address.
Call-saved registers r8..r13 also don't need to be restored. */
Call-saved registers r8..r13 also don't need to be restored.
To test that we look for register push insns such as 'mov.l r0,@-r15'. */
/* { dg-do compile { target { { "sh*-*-*" } && nonpic } } } */
/* { dg-skip-if "" { "sh*-*-*" } { "-m1*" "-m2*" "-m5*" } { "" } } */
/* { dg-options "-O" } */
/* { dg-final { scan-assembler-times "rte" 1 } } */
/* { dg-final { scan-assembler-not "\[^f\]r\[0-9\]\[ \t\]*," } } */
/* { dg-final { scan-assembler-not "\[^f\]r\[89\]" } } */
/* { dg-final { scan-assembler-not "\[^f\]r1\[,0-3\]" } } */
/* { dg-final { scan-assembler-not "mov.l\tr\[0-9\],@-r15" } } */
/* { dg-final { scan-assembler-not "mov.l\tr1\[0-4\],@-r15" } } */
/* { dg-final { scan-assembler-times "macl" 2 } } */
extern void bar (void);

View File

@ -3,10 +3,8 @@
/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */
/* { dg-options "-O" } */
/* { dg-final { scan-assembler-times "rte" 1 } } */
/* { dg-final { scan-assembler-not "r\[0-7\]\[ \t,\]\[^\n\]*r15" } } */
/* { dg-final { scan-assembler-not "@r15\[^\n\]*r\[0-7\]\n" } } */
/* { dg-final { scan-assembler-not "r\[8-9\]" } } */
/* { dg-final { scan-assembler-not "r1\[,0-3\]" } } */
/* { dg-final { scan-assembler-not "mov.l\tr\[0-9\],@-r15" } } */
/* { dg-final { scan-assembler-not "mov.l\tr1\[0-4\],@-r15" } } */
/* { dg-final { scan-assembler-not "macl" } } */
extern void foo (void);

View File

@ -1,6 +1,14 @@
/* The call will clobber r0..r7, which will need not be saved/restored, but
not the call-saved registers r8..r14. Check this by counting the register
push insns. */
/* { dg-do compile { target { { { sh-*-* sh[1234ble]*-*-* } && { ! sh2a*-*-* } } && nonpic } } } */
/* { dg-skip-if "" { "sh*-*-*" } { "-m2a*" } { "" } } */
/* { dg-options "-O" } */
/* { dg-final { scan-assembler-times "rte" 1} } */
/* { dg-final { scan-assembler-times "mov.l\tr\[0-7\],@-r15" 8 } } */
/* { dg-final { scan-assembler-not "mov.l\tr\[89\],@-r15" } } */
/* { dg-final { scan-assembler-not "mov.l\tr1\[0-4\],@-r15" } } */
extern void foo ();
void
@ -8,13 +16,3 @@ void
{
foo ();
}
/* { dg-final { scan-assembler-times "rte" 1} } */
/* The call will clobber r0..r7, which will need not be saved/restored.
One of these registers will do fine to hold the function address,
hence the all-saved registers r8..r13 don't need to be restored. */
/* { dg-final { scan-assembler-times "r15\[+\],\[ \t\]*r\[0-9\]\[ \t\]*\n" 8 } } */
/* { dg-final { scan-assembler-times "\[^f\]r\[0-9\]\[ \t\]*," 8 } } */
/* { dg-final { scan-assembler-not "\[^f\]r1\[0-3\]" } } */
/* { dg-final { scan-assembler-times "macl" 2} } */
/* { dg-final { scan-assembler-not "rte.*\n.*r15\[+\],r\[0-7\]\n" } } */

View File

@ -1,15 +1,14 @@
/* A call will clobber all call-saved registers.
If #pragma nosave_low_regs is specified, do not save/restore r0..r7.
(On SH3* and SH4* r0..r7 are banked)
One of these registers will also do fine to hold the function address.
Call-saved registers r8..r13 also don't need to be restored. */
Call-saved registers r8..r14 also don't need to be restored.
To test that we look for register push insns such as 'mov.l r0,@-r15'. */
/* { dg-do compile { target { { "sh*-*-*" } && nonpic } } } */
/* { dg-skip-if "" { "sh*-*-*" } { "-m1*" "-m2*" "-m5*" } { "" } } */
/* { dg-options "-O" } */
/* { dg-final { scan-assembler-times "rte" 1 } } */
/* { dg-final { scan-assembler-not "\[^f\]r\[0-9\]\[ \t\]*," } } */
/* { dg-final { scan-assembler-not "\[^f\]r\[89\]" } } */
/* { dg-final { scan-assembler-not "\[^f\]r1\[,0-3\]" } } */
/* { dg-final { scan-assembler-not "mov.l\tr\[0-9\],@-r15" } } */
/* { dg-final { scan-assembler-not "mov.l\tr1\[0-4\],@-r15" } } */
/* { dg-final { scan-assembler-times "macl" 2 } } */
extern void foo (void);

View File

@ -3,10 +3,8 @@
/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */
/* { dg-options "-O" } */
/* { dg-final { scan-assembler-times "rte" 1 } } */
/* { dg-final { scan-assembler-not "r\[0-7\]\[ \t,\]\[^\n\]*r15" } } */
/* { dg-final { scan-assembler-not "@r15\[^\n\]*r\[0-7\]\n" } } */
/* { dg-final { scan-assembler-not "r\[8-9\]" } } */
/* { dg-final { scan-assembler-not "r1\[,0-3\]" } } */
/* { dg-final { scan-assembler-not "mov.l\tr\[0-9\],@-r15" } } */
/* { dg-final { scan-assembler-not "mov.l\tr1\[0-4\],@-r15" } } */
/* { dg-final { scan-assembler-not "macl" } } */
extern void foo (void);

View File

@ -6,13 +6,12 @@
/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2" "-m3" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */
/* { dg-options "-O" } */
/* { dg-final { scan-assembler-times "rte" 1 } } */
/* { dg-final { scan-assembler-times "r\[0-7\]\n" 3 } } */
/* { dg-final { scan-assembler-not "r\[8-9\]" } } */
/* { dg-final { scan-assembler-not "r1\[,0-3\]" } } */
/* { dg-final { scan-assembler-not "mov.l\tr\[0-9\],@-r15" } } */
/* { dg-final { scan-assembler-not "mov.l\tr1\[0-4\],@-r15" } } */
/* { dg-final { scan-assembler-not "macl" } } */
/* Expect that fpscr needs to be saved, loaded and restored. */
/* { dg-final { scan-assembler-times "\[^_\]fpscr" 3 } } */
/* { dg-final { scan-assembler-times "\[^_\]fpscr" 4 } } */
extern void foo (void);