Testcases for mips conditional move patterns.
* gcc.dg/mips-movcc-1.c: New test. * gcc.dg/mips-movcc-2.c: New test. * gcc.dg/mips-movcc-3.c: New test. From-SVN: r86146
This commit is contained in:
parent
4ef47bd8e0
commit
67e9009398
@ -1,3 +1,9 @@
|
||||
2004-08-17 James E Wilson <wilson@specifixinc.com>
|
||||
|
||||
* gcc.dg/mips-movcc-1.c: New test.
|
||||
* gcc.dg/mips-movcc-2.c: New test.
|
||||
* gcc.dg/mips-movcc-3.c: New test.
|
||||
|
||||
2004-08-17 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/15871
|
||||
|
23
gcc/testsuite/gcc.dg/mips-movcc-1.c
Normal file
23
gcc/testsuite/gcc.dg/mips-movcc-1.c
Normal file
@ -0,0 +1,23 @@
|
||||
/* { dg-do compile { target "mips*-*-*" } } */
|
||||
/* { dg-options "-O2 -mips4" } */
|
||||
/* { dg-final { scan-assembler "movz" } } */
|
||||
/* { dg-final { scan-assembler "movn" } } */
|
||||
/* { dg-final { scan-assembler "movt" } } */
|
||||
|
||||
int
|
||||
sub1 (int i, int j, int k)
|
||||
{
|
||||
return k ? i : j;
|
||||
}
|
||||
|
||||
int
|
||||
sub2 (int i, int j, long l)
|
||||
{
|
||||
return !l ? i : j;
|
||||
}
|
||||
|
||||
int
|
||||
sub3 (int i, int j, float f)
|
||||
{
|
||||
return f ? i : j;
|
||||
}
|
23
gcc/testsuite/gcc.dg/mips-movcc-2.c
Normal file
23
gcc/testsuite/gcc.dg/mips-movcc-2.c
Normal file
@ -0,0 +1,23 @@
|
||||
/* { dg-do compile { target "mips*-*-*" } } */
|
||||
/* { dg-options "-O2 -mips4" } */
|
||||
/* { dg-final { scan-assembler "movz" } } */
|
||||
/* { dg-final { scan-assembler "movn" } } */
|
||||
/* { dg-final { scan-assembler "movf" } } */
|
||||
|
||||
long
|
||||
sub4 (long i, long j, long k)
|
||||
{
|
||||
return k ? i : j;
|
||||
}
|
||||
|
||||
long
|
||||
sub5 (long i, long j, int k)
|
||||
{
|
||||
return !k ? i : j;
|
||||
}
|
||||
|
||||
long
|
||||
sub6 (long i, long j, float f)
|
||||
{
|
||||
return !f ? i : j;
|
||||
}
|
44
gcc/testsuite/gcc.dg/mips-movcc-3.c
Normal file
44
gcc/testsuite/gcc.dg/mips-movcc-3.c
Normal file
@ -0,0 +1,44 @@
|
||||
/* { dg-do compile { target "mips*-*-*" } } */
|
||||
/* { dg-options "-O2 -mips4" } */
|
||||
/* { dg-final { scan-assembler "movz.s" } } */
|
||||
/* { dg-final { scan-assembler "movn.s" } } */
|
||||
/* { dg-final { scan-assembler "movt.s" } } */
|
||||
/* { dg-final { scan-assembler "movz.d" } } */
|
||||
/* { dg-final { scan-assembler "movn.d" } } */
|
||||
/* { dg-final { scan-assembler "movf.d" } } */
|
||||
|
||||
float
|
||||
sub7 (float f, float g, int i)
|
||||
{
|
||||
return i ? f : g;
|
||||
}
|
||||
|
||||
float
|
||||
sub8 (float f, float g, long l)
|
||||
{
|
||||
return !l ? f : g;
|
||||
}
|
||||
|
||||
float
|
||||
sub9 (float f, float g, float h)
|
||||
{
|
||||
return h ? f : g;
|
||||
}
|
||||
|
||||
double
|
||||
suba (double f, double g, int i)
|
||||
{
|
||||
return i ? f : g;
|
||||
}
|
||||
|
||||
double
|
||||
subb (double f, double g, long l)
|
||||
{
|
||||
return !l ? f : g;
|
||||
}
|
||||
|
||||
double
|
||||
subc (double f, double g, double h)
|
||||
{
|
||||
return !h ? f : g;
|
||||
}
|
Loading…
Reference in New Issue
Block a user