From 30093f0492dcf588c2225831365f170e3ee77816 Mon Sep 17 00:00:00 2001 From: Chao-ying Fu Date: Tue, 1 Dec 2009 01:40:28 +0000 Subject: [PATCH] dsp-lhx.c: New test. 2009-11-30 Chao-ying Fu * gcc.target/mips/dsp-lhx.c: New test. * gcc.target/mips/dsp-no-lhx.c: New test. From-SVN: r154862 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/mips/dsp-lhx.c | 10 ++++++++++ gcc/testsuite/gcc.target/mips/dsp-no-lhx.c | 10 ++++++++++ 3 files changed, 25 insertions(+) create mode 100644 gcc/testsuite/gcc.target/mips/dsp-lhx.c create mode 100644 gcc/testsuite/gcc.target/mips/dsp-no-lhx.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e97ca5a0fc90..382406f5194a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-11-30 Chao-ying Fu + + * gcc.target/mips/dsp-lhx.c: New test. + * gcc.target/mips/dsp-no-lhx.c: New test. + 2009-11-30 Dave Korn * 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 index 000000000000..416356f2a030 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/dsp-lhx.c @@ -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 index 000000000000..a37c42f1a900 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/dsp-no-lhx.c @@ -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]; +}