2009-11-30 Chao-ying Fu <fu@mips.com>
authorchaoyingfu <chaoyingfu@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Dec 2009 01:40:28 +0000 (01:40 +0000)
committerchaoyingfu <chaoyingfu@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Dec 2009 01:40:28 +0000 (01:40 +0000)
* gcc.target/mips/dsp-lhx.c: New test.
* gcc.target/mips/dsp-no-lhx.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154862 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/mips/dsp-lhx.c [new file with mode: 0644]
gcc/testsuite/gcc.target/mips/dsp-no-lhx.c [new file with mode: 0644]

index e97ca5a..382406f 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-30  Chao-ying Fu  <fu@mips.com>
+
+       * gcc.target/mips/dsp-lhx.c: New test.
+       * gcc.target/mips/dsp-no-lhx.c: New test.
+
 2009-11-30  Dave Korn  <dave.korn.cygwin@gmail.com>
 
        * lib/g++.exp (g++_init): Add host-dependent settings for
diff --git a/gcc/testsuite/gcc.target/mips/dsp-lhx.c b/gcc/testsuite/gcc.target/mips/dsp-lhx.c
new file mode 100644 (file)
index 0000000..416356f
--- /dev/null
@@ -0,0 +1,10 @@
+/* Test MIPS32 DSP LHX instruction */
+/* { dg-do compile } */
+/* { dg-options "-mgp32 -mdsp -O2" } */
+
+/* { dg-final { scan-assembler "\tlhx\t" } } */
+
+NOMIPS16 signed short test (signed short *a, int index)
+{
+  return a[index];
+}
diff --git a/gcc/testsuite/gcc.target/mips/dsp-no-lhx.c b/gcc/testsuite/gcc.target/mips/dsp-no-lhx.c
new file mode 100644 (file)
index 0000000..a37c42f
--- /dev/null
@@ -0,0 +1,10 @@
+/* Test MIPS32 DSP LHX instruction */
+/* { dg-do compile } */
+/* { dg-options "-mgp32 -mdsp -O2" } */
+
+/* { dg-final { scan-assembler-not "\tlhx\t" } } */
+
+NOMIPS16 unsigned short test (unsigned short *a, int index)
+{
+  return a[index];
+}