diff options
author | Chao-ying Fu <fu@mips.com> | 2008-11-03 23:58:10 +0000 |
---|---|---|
committer | Catherine Moore <clm@gcc.gnu.org> | 2008-11-03 18:58:10 -0500 |
commit | a72bd667e06cc42d7b0027d3cd6135752bc45efc (patch) | |
tree | 6814ad4cf14f8c7c84ed7c2a41b5fd274f1f2976 /gcc | |
parent | 1e27273ff09c94c23e5823710f2bc3722e9fab5c (diff) | |
download | gcc-a72bd667e06cc42d7b0027d3cd6135752bc45efc.zip gcc-a72bd667e06cc42d7b0027d3cd6135752bc45efc.tar.gz gcc-a72bd667e06cc42d7b0027d3cd6135752bc45efc.tar.bz2 |
* gcc.target/mips/dsp-ctrl.c: New test.
From-SVN: r141569
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/mips/dsp-ctrl.c | 80 |
2 files changed, 84 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 72ef87d..28f2ad9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-11-03 Chao-ying Fu <fu@mips.com> + + * gcc.target/mips/dsp-ctrl.c: New test. + 2008-11-03 Steve Ellcey <sje@cup.hp.com> * gfortran.dg/f2003_io_1.f03: XFAIL until PR37839 is fixed. diff --git a/gcc/testsuite/gcc.target/mips/dsp-ctrl.c b/gcc/testsuite/gcc.target/mips/dsp-ctrl.c new file mode 100644 index 0000000..97e93bc --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/dsp-ctrl.c @@ -0,0 +1,80 @@ +/* { dg-do run { target mips*-*-* } } */ +/* { dg-options "-O2" } */ + +extern void abort (void); +extern void exit (int); +#if __mips_dsp + +void __attribute__ ((noinline)) +test1 (int i) +{ + __builtin_mips_wrdsp (i, 63); +} + +void __attribute__ ((noinline)) +test2 () +{ + long long a = 0; + __builtin_mips_extpdp (a, 3); +} + +void __attribute__ ((noinline)) +test3 (int i) +{ + long long a = 0; + __builtin_mips_extpdp (a, i); +} + +void __attribute__ ((noinline)) +test4 () +{ + long long a = 0; + int i = 0; + __builtin_mips_mthlip (a, i); +} + +int +main () +{ + int cntl; + + /* Test 1: wrdsp */ + __builtin_mips_wrdsp (0,63); + test1 (63); + cntl = __builtin_mips_rddsp (63); + if (cntl != 63) + abort (); + + /* Test 2: extpdp */ + __builtin_mips_wrdsp (63,63); + test2 (); + cntl = __builtin_mips_rddsp (63); + if (cntl != 59) + abort (); + + /* Test 3: extpdpv */ + __builtin_mips_wrdsp (63,63); + test3 (10); + cntl = __builtin_mips_rddsp (63); + if (cntl != 52) + abort (); + + /* Test 4: mthlip */ + __builtin_mips_wrdsp (8,63); + test4 (); + cntl = __builtin_mips_rddsp (63); + if (cntl != 40) + abort (); + + exit (0); +} + +#else + +int +main () +{ + exit (0); +} + +#endif |