public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch] Cleanup gcc.target/arm/interrupt-*.c for thumb mode
@ 2013-02-13 14:40 Greta Yorsh
  2013-02-14 23:19 ` Janis Johnson
  0 siblings, 1 reply; 2+ messages in thread
From: Greta Yorsh @ 2013-02-13 14:40 UTC (permalink / raw)
  To: GCC Patches; +Cc: Ramana Radhakrishnan, Richard Earnshaw

[-- Attachment #1: Type: text/plain, Size: 416 bytes --]

The tests gcc.target/arm/interrupt-*.c are for ARM mode only. 
This patch uses effective target arm_notthumb instead of __thumb_ predefine,
removes unreachable code, and fixes typos.

Ok for trunk?

Thanks,
Greta

ChangeLog

gcc/testsuite/

2012-02-13  Greta Yorsh  <Greta.Yorsh@arm.com>

        * gcc.target/arm/interrupt-1.c: Fix for thumb mode.
        * gcc.target/arm/interrupt-2.c: Likewise.

[-- Attachment #2: 3-arm-adjust-tests-interrupt.v2.patch.txt --]
[-- Type: text/plain, Size: 2246 bytes --]

diff --git a/gcc/testsuite/gcc.target/arm/interrupt-1.c b/gcc/testsuite/gcc.target/arm/interrupt-1.c
index 18379de..a384242 100644
--- a/gcc/testsuite/gcc.target/arm/interrupt-1.c
+++ b/gcc/testsuite/gcc.target/arm/interrupt-1.c
@@ -1,10 +1,10 @@
 /* Verify that prologue and epilogue are correct for functions with
    __attribute__ ((interrupt)).  */
 /* { dg-do compile } */
-/* { dg-options "-O0" } */
+/* { dg-require-effective-target arm_nothumb } */
+/* { dg-options "-O0 -marm" } */
 
-/* This test is not valid when -mthumb.  We just cheat.  */
-#ifndef __thumb__
+/* This test is not valid when -mthumb.  */
 extern void bar (int);
 extern void foo (void) __attribute__ ((interrupt("IRQ")));
 
@@ -12,12 +12,6 @@ void foo ()
 {
   bar (0);
 }
-#else
-void foo ()
-{
-  asm ("stmfd\tsp!, {r0, r1, r2, r3, r4, fp, ip, lr}");
-  asm ("ldmfd\tsp!, {r0, r1, r2, r3, r4, fp, ip, pc}^");
-}
-#endif
+
 /* { dg-final { scan-assembler "stmfd\tsp!, {r0, r1, r2, r3, r4, fp, ip, lr}" } } */
 /* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, fp, ip, pc}\\^" } } */
diff --git a/gcc/testsuite/gcc.target/arm/interrupt-2.c b/gcc/testsuite/gcc.target/arm/interrupt-2.c
index b979bf1..61d3130 100644
--- a/gcc/testsuite/gcc.target/arm/interrupt-2.c
+++ b/gcc/testsuite/gcc.target/arm/interrupt-2.c
@@ -1,26 +1,19 @@
 /* Verify that prologue and epilogue are correct for functions with
    __attribute__ ((interrupt)).  */
 /* { dg-do compile } */
-/* { dg-options "-O1" } */
+/* { dg-require-effective-target arm_nothumb } */
+/* { dg-options "-O1 -marm" } */
 
-/* This test is not valid when -mthum.  We just cheat.  */
-#ifndef __thumb__
+/* This test is not valid when -mthumb.  */
 extern void bar (int);
 extern void test (void) __attribute__((__interrupt__));
 
 int foo;
 void test()
 {
-  funcptrs(foo);
+  bar (foo);
   foo = 0;
 }
-#else
-void test ()
-{
-  asm ("stmfd\tsp!, {r0, r1, r2, r3, r4, r5, ip, lr}");
-  asm ("ldmfd\tsp!, {r0, r1, r2, r3, r4, r5, ip, pc}^");
-}
-#endif
 
 /* { dg-final { scan-assembler "stmfd\tsp!, {r0, r1, r2, r3, r4, r5, ip, lr}" } } */
 /* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, r5, ip, pc}\\^" } } */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Patch] Cleanup gcc.target/arm/interrupt-*.c for thumb mode
  2013-02-13 14:40 [Patch] Cleanup gcc.target/arm/interrupt-*.c for thumb mode Greta Yorsh
@ 2013-02-14 23:19 ` Janis Johnson
  0 siblings, 0 replies; 2+ messages in thread
From: Janis Johnson @ 2013-02-14 23:19 UTC (permalink / raw)
  To: Greta Yorsh; +Cc: GCC Patches, Ramana Radhakrishnan, Richard Earnshaw

On 02/13/2013 06:39 AM, Greta Yorsh wrote:
> The tests gcc.target/arm/interrupt-*.c are for ARM mode only. 
> This patch uses effective target arm_notthumb instead of __thumb_ predefine,
> removes unreachable code, and fixes typos.
> 
> Ok for trunk?
> 
OK

Janis

> Thanks,
> Greta
> 
> ChangeLog
> 
> gcc/testsuite/
> 
> 2012-02-13  Greta Yorsh  <Greta.Yorsh@arm.com>
> 
>         * gcc.target/arm/interrupt-1.c: Fix for thumb mode.
>         * gcc.target/arm/interrupt-2.c: Likewise.
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-02-14 23:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-13 14:40 [Patch] Cleanup gcc.target/arm/interrupt-*.c for thumb mode Greta Yorsh
2013-02-14 23:19 ` Janis Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).