aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/sh/pr58219.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/sh/pr58219.c')
-rw-r--r--gcc/testsuite/gcc.target/sh/pr58219.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/sh/pr58219.c b/gcc/testsuite/gcc.target/sh/pr58219.c
new file mode 100644
index 00000000000..d900f72eae8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sh/pr58219.c
@@ -0,0 +1,60 @@
+/* Check that move instructions have the correct length on SH2A. */
+/* { dg-do compile } */
+/* { dg-options "-O1 -dp" } */
+
+/* { dg-final { scan-assembler-times "length = 4" 10 { target { "sh2a" && any_fpu } } } } */
+/* { dg-final { scan-assembler-times "length = 4" 8 { target { "sh2a" && no_fpu } } } } */
+
+int
+test_00 (int* x)
+{
+ return x[0];
+}
+
+int
+test_01 (int* x)
+{
+ return x[1];
+}
+
+int
+test_02 (int* x)
+{
+ return x[100];
+}
+
+int
+test_03 (int* x, unsigned int y)
+{
+ return *(int*)((unsigned int)x + y);
+}
+
+float
+test_04 (float* x)
+{
+ return x[0];
+}
+
+float
+test_05 (float* x)
+{
+ return x[5];
+}
+
+float
+test_06 (float* x)
+{
+ return x[100];
+}
+
+int
+test_07 (void)
+{
+ return 1230;
+}
+
+int
+test_08 (void)
+{
+ return 0xFF0000;
+}