From: James E Wilson Date: Tue, 17 Aug 2004 21:19:49 +0000 (+0000) Subject: Testcases for mips conditional move patterns. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=67e90093984469e9d9b8573092e09d5ef47decc5;p=gcc.git 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 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 621d0cf2969..74abe0e4657 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2004-08-17 James E Wilson + + * 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 PR c++/15871 diff --git a/gcc/testsuite/gcc.dg/mips-movcc-1.c b/gcc/testsuite/gcc.dg/mips-movcc-1.c new file mode 100644 index 00000000000..b433a4d45b5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/mips-movcc-1.c @@ -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; +} diff --git a/gcc/testsuite/gcc.dg/mips-movcc-2.c b/gcc/testsuite/gcc.dg/mips-movcc-2.c new file mode 100644 index 00000000000..d8ea4cc6ba1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/mips-movcc-2.c @@ -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; +} diff --git a/gcc/testsuite/gcc.dg/mips-movcc-3.c b/gcc/testsuite/gcc.dg/mips-movcc-3.c new file mode 100644 index 00000000000..9e515fa6a30 --- /dev/null +++ b/gcc/testsuite/gcc.dg/mips-movcc-3.c @@ -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; +}