2014-07-09 Tom de Vries <tom@codesourcery.com>
* gcc.target/mips/fuse-caller-save.c: Remove test on number of stores.
* gcc.target/mips/fuse-caller-save-mips16.c: Same.
* gcc.target/mips/fuse-caller-save-micromips.c: Same.
* gcc.target/mips/fuse-caller-save-neg.c: New test.
* gcc.target/mips/fuse-caller-save-mips16-neg.c: Same.
* gcc.target/mips/fuse-caller-save-micromips-neg.c: Same.
new file mode 100644
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-use-caller-save (-mmicromips)" } */
+/* At -O0 and -O1, the register allocator behaves more conservatively, and
+ the fuse-caller-save optimization doesnt' trigger. */
+/* { dg-skip-if "" { *-*-* } { "-O0" "-O1" } } */
+/* Testing -fuse-caller-save optimization option. */
+
+#define ATTRIBUTE MICROMIPS
+#include "fuse-caller-save.h"
+
+/* Check that the first caller-save register is used. This is to make sure that
+ test fuse-caller-save-mips16 tests something meaningful. */
+/* { dg-final { scan-assembler "\\\$16" } } */
@@ -8,10 +8,5 @@
#define ATTRIBUTE MICROMIPS
#include "fuse-caller-save.h"
-/* Check that there are only 2 stack-saves: r31 in main and foo. */
-
-/* Check that there only 2 sw/sd. */
-/* { dg-final { scan-assembler-times "(?n)s\[wd\]\t\\\$.*,.*\\(\\\$sp\\)" 2 } } */
-
/* Check that the first caller-save register is unused. */
/* { dg-final { scan-assembler-not "\\\$16" } } */
new file mode 100644
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-use-caller-save (-mips16)" } */
+/* At -O0 and -O1, the register allocator behaves more conservatively, and
+ the fuse-caller-save optimization doesnt' trigger. */
+/* { dg-skip-if "" { *-*-* } { "-O0" "-O1" } } */
+/* Testing -fuse-caller-save optimization option. */
+
+#define ATTRIBUTE MIPS16
+#include "fuse-caller-save.h"
+
+/* Check that the first caller-save register is used. This is to make sure that
+ test fuse-caller-save-mips16 tests something meaningful. */
+/* { dg-final { scan-assembler "\\\$16" } } */
@@ -8,10 +8,5 @@
#define ATTRIBUTE MIPS16
#include "fuse-caller-save.h"
-/* Check that there are only 2 stack-saves: r31 in main and foo. */
-
-/* Check that there only 2 sw/sd. */
-/* { dg-final { scan-assembler-times "(?n)s\[wd\]\t\\\$.*,.*\\(\\\$sp\\)" 2 } } */
-
/* Check that the first caller-save register is unused. */
/* { dg-final { scan-assembler-not "\\\$16" } } */
new file mode 100644
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-use-caller-save" } */
+/* At -O0 and -O1, the register allocator behaves more conservatively, and
+ the fuse-caller-save optimization doesnt' trigger. */
+/* { dg-skip-if "" { *-*-* } { "-O0" "-O1" } } */
+/* Testing -fuse-caller-save optimization option. */
+
+#define ATTRIBUTE NOCOMPRESSION
+#include "fuse-caller-save.h"
+
+/* Check that the first caller-save register is used. This is to make sure that
+ test fuse-caller-save-mips16 tests something meaningful. */
+/* { dg-final { scan-assembler "\\\$16" } } */
@@ -10,8 +10,5 @@
/* Check that there are only 2 stack-saves: r31 in main and foo. */
-/* Check that there only 2 sw/sd. */
-/* { dg-final { scan-assembler-times "(?n)s\[wd\]\t\\\$.*,.*\\(\\\$sp\\)" 2 } } */
-
/* Check that the first caller-save register is unused. */
/* { dg-final { scan-assembler-not "\\\$16" } } */
--
1.9.1