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]

New tests for Blackfin longcalls


This adds tests to verify that long calls are working as expected on the Blackfin. ARM and RS/6000 could probably use something similar.


Bernd
	* gcc.dg/bfin-longcall-1.c: New file.
	* gcc.dg/bfin-longcall-2.c: New file.

Index: testsuite/gcc.dg/bfin-longcall-1.c
===================================================================
RCS file: testsuite/gcc.dg/bfin-longcall-1.c
diff -N testsuite/gcc.dg/bfin-longcall-1.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/gcc.dg/bfin-longcall-1.c	22 Jul 2005 09:34:10 -0000
***************
*** 0 ****
--- 1,33 ----
+ /* { dg-do compile { target bfin-*-* } } */
+ /* { dg-options "-O2" } */
+ /* { dg-final { scan-assembler-not "call\[^\\n\]*foo" } } */
+ /* { dg-final { scan-assembler-not "jump\[^\\n\]*foo" } } */
+ /* { dg-final { scan-assembler "call\[^\\n\]*baz" } } */
+ /* { dg-final { scan-assembler "jump\[^\\n\]*baz" } } */
+ /* { dg-final { scan-assembler "call\[^\\n\]*bar" } } */
+ /* { dg-final { scan-assembler "jump\[^\\n\]*bar" } } */
+ 
+ extern void foo () __attribute__((longcall));
+ extern void bar () __attribute__((shortcall));
+ extern void baz ();
+ 
+ int t1 ()
+ {
+     foo ();
+     bar ();
+     baz ();
+     return 4;
+ }
+ 
+ void t2 ()
+ {
+     foo ();
+ }
+ void t3 ()
+ {
+     bar ();
+ }
+ void t4 ()
+ {
+     baz ();
+ }
Index: testsuite/gcc.dg/bfin-longcall-2.c
===================================================================
RCS file: testsuite/gcc.dg/bfin-longcall-2.c
diff -N testsuite/gcc.dg/bfin-longcall-2.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/gcc.dg/bfin-longcall-2.c	22 Jul 2005 09:34:10 -0000
***************
*** 0 ****
--- 1,33 ----
+ /* { dg-do compile { target bfin-*-* } } */
+ /* { dg-options "-O2 -mlong-calls" } */
+ /* { dg-final { scan-assembler-not "call\[^\\n\]*foo" } } */
+ /* { dg-final { scan-assembler-not "jump\[^\\n\]*foo" } } */
+ /* { dg-final { scan-assembler-not "call\[^\\n\]*baz" } } */
+ /* { dg-final { scan-assembler-not "jump\[^\\n\]*baz" } } */
+ /* { dg-final { scan-assembler "call\[^\\n\]*bar" } } */
+ /* { dg-final { scan-assembler "jump\[^\\n\]*bar" } } */
+ 
+ extern void foo () __attribute__((longcall));
+ extern void bar () __attribute__((shortcall));
+ extern void baz ();
+ 
+ int t1 ()
+ {
+     foo ();
+     bar ();
+     baz ();
+     return 4;
+ }
+ 
+ void t2 ()
+ {
+     foo ();
+ }
+ void t3 ()
+ {
+     bar ();
+ }
+ void t4 ()
+ {
+     baz ();
+ }

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