From 8ab48a7bfaff8ac2506ae92db56d9b8f3d7e4a9b Mon Sep 17 00:00:00 2001 From: Georg-Johann Lay Date: Thu, 23 Aug 2012 08:11:56 +0000 Subject: [PATCH] convert.c: Split into manageable parts: * gcc.dg/fixed-point/convert.c: Split into manageable parts: * gcc.dg/fixed-point/convert-1.c: New. * gcc.dg/fixed-point/convert-2.c: New. * gcc.dg/fixed-point/convert-3.c: New. * gcc.dg/fixed-point/convert-4.c: New. * gcc.dg/fixed-point/convert-float-1.c: New. * gcc.dg/fixed-point/convert-float-2.c: New. * gcc.dg/fixed-point/convert-float-3.c: New. * gcc.dg/fixed-point/convert-float-4.c: New. * gcc.dg/fixed-point/convert-accum-neg.c: New. * gcc.dg/fixed-point/convert-sat.c: New. * gcc.dg/fixed-point/convert.h: New. From-SVN: r190615 --- gcc/testsuite/ChangeLog | 15 +++ gcc/testsuite/gcc.dg/fixed-point/convert-1.c | 20 ++++ gcc/testsuite/gcc.dg/fixed-point/convert-2.c | 20 ++++ gcc/testsuite/gcc.dg/fixed-point/convert-3.c | 20 ++++ gcc/testsuite/gcc.dg/fixed-point/convert-4.c | 20 ++++ .../gcc.dg/fixed-point/convert-accum-neg.c | 33 +++++++ .../gcc.dg/fixed-point/convert-float-1.c | 20 ++++ .../gcc.dg/fixed-point/convert-float-2.c | 20 ++++ .../gcc.dg/fixed-point/convert-float-3.c | 20 ++++ .../gcc.dg/fixed-point/convert-float-4.c | 20 ++++ .../gcc.dg/fixed-point/convert-sat.c | 45 +++++++++ .../fixed-point/{convert.c => convert.h} | 91 ++----------------- 12 files changed, 262 insertions(+), 82 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/fixed-point/convert-1.c create mode 100644 gcc/testsuite/gcc.dg/fixed-point/convert-2.c create mode 100644 gcc/testsuite/gcc.dg/fixed-point/convert-3.c create mode 100644 gcc/testsuite/gcc.dg/fixed-point/convert-4.c create mode 100644 gcc/testsuite/gcc.dg/fixed-point/convert-accum-neg.c create mode 100644 gcc/testsuite/gcc.dg/fixed-point/convert-float-1.c create mode 100644 gcc/testsuite/gcc.dg/fixed-point/convert-float-2.c create mode 100644 gcc/testsuite/gcc.dg/fixed-point/convert-float-3.c create mode 100644 gcc/testsuite/gcc.dg/fixed-point/convert-float-4.c create mode 100644 gcc/testsuite/gcc.dg/fixed-point/convert-sat.c rename gcc/testsuite/gcc.dg/fixed-point/{convert.c => convert.h} (87%) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3c4db30985b..6f8cae84bd1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,18 @@ +2012-08-23 Georg-Johann Lay + + * gcc.dg/fixed-point/convert.c: Split into manageable parts: + * gcc.dg/fixed-point/convert-1.c: New. + * gcc.dg/fixed-point/convert-2.c: New. + * gcc.dg/fixed-point/convert-3.c: New. + * gcc.dg/fixed-point/convert-4.c: New. + * gcc.dg/fixed-point/convert-float-1.c: New. + * gcc.dg/fixed-point/convert-float-2.c: New. + * gcc.dg/fixed-point/convert-float-3.c: New. + * gcc.dg/fixed-point/convert-float-4.c: New. + * gcc.dg/fixed-point/convert-accum-neg.c: New. + * gcc.dg/fixed-point/convert-sat.c: New. + * gcc.dg/fixed-point/convert.h: New. + 2012-08-22 Oleg Endo PR target/54089 diff --git a/gcc/testsuite/gcc.dg/fixed-point/convert-1.c b/gcc/testsuite/gcc.dg/fixed-point/convert-1.c new file mode 100644 index 00000000000..04adea88bfa --- /dev/null +++ b/gcc/testsuite/gcc.dg/fixed-point/convert-1.c @@ -0,0 +1,20 @@ +/* { dg-do run } */ +/* { dg-options "-std=gnu99 -O0" } */ + +/* C99 6.3 Conversions. + + Check conversions involving fixed-point. */ + +extern void abort (void); + +#include "convert.h" + +int main () +{ + ALL_CONV (short _Fract, hr); + ALL_CONV (_Fract, r); + ALL_CONV (long _Fract, lr); + ALL_CONV (long long _Fract, llr); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/fixed-point/convert-2.c b/gcc/testsuite/gcc.dg/fixed-point/convert-2.c new file mode 100644 index 00000000000..fc5bc1fcbbf --- /dev/null +++ b/gcc/testsuite/gcc.dg/fixed-point/convert-2.c @@ -0,0 +1,20 @@ +/* { dg-do run } */ +/* { dg-options "-std=gnu99 -O0" } */ + +/* C99 6.3 Conversions. + + Check conversions involving fixed-point. */ + +extern void abort (void); + +#include "convert.h" + +int main () +{ + ALL_CONV (unsigned short _Fract, uhr); + ALL_CONV (unsigned _Fract, ur); + ALL_CONV (unsigned long _Fract, ulr); + ALL_CONV (unsigned long long _Fract, ullr); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/fixed-point/convert-3.c b/gcc/testsuite/gcc.dg/fixed-point/convert-3.c new file mode 100644 index 00000000000..753c472a844 --- /dev/null +++ b/gcc/testsuite/gcc.dg/fixed-point/convert-3.c @@ -0,0 +1,20 @@ +/* { dg-do run } */ +/* { dg-options "-std=gnu99 -O0" } */ + +/* C99 6.3 Conversions. + + Check conversions involving fixed-point. */ + +extern void abort (void); + +#include "convert.h" + +int main () +{ + ALL_CONV (short _Accum, hk); + ALL_CONV (_Accum, k); + ALL_CONV (long _Accum, lk); + ALL_CONV (long long _Accum, llk); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/fixed-point/convert-4.c b/gcc/testsuite/gcc.dg/fixed-point/convert-4.c new file mode 100644 index 00000000000..17c4e66ebb7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/fixed-point/convert-4.c @@ -0,0 +1,20 @@ +/* { dg-do run } */ +/* { dg-options "-std=gnu99 -O0" } */ + +/* C99 6.3 Conversions. + + Check conversions involving fixed-point. */ + +extern void abort (void); + +#include "convert.h" + +int main () +{ + ALL_CONV (unsigned short _Accum, uhk); + ALL_CONV (unsigned _Accum, uk); + ALL_CONV (unsigned long _Accum, ulk); + ALL_CONV (unsigned long long _Accum, ullk); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/fixed-point/convert-accum-neg.c b/gcc/testsuite/gcc.dg/fixed-point/convert-accum-neg.c new file mode 100644 index 00000000000..af956104290 --- /dev/null +++ b/gcc/testsuite/gcc.dg/fixed-point/convert-accum-neg.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-options "-std=gnu99 -O0" } */ + +/* C99 6.3 Conversions. + + Check conversions involving fixed-point. */ + +extern void abort (void); + +#include "convert.h" + +int main () +{ + ALL_ACCUM_CONV (short _Accum, hk); + ALL_ACCUM_CONV (_Accum, k); + ALL_ACCUM_CONV (long _Accum, lk); + ALL_ACCUM_CONV (long long _Accum, llk); + ALL_ACCUM_CONV (unsigned short _Accum, uhk); + ALL_ACCUM_CONV (unsigned _Accum, uk); + ALL_ACCUM_CONV (unsigned long _Accum, ulk); + ALL_ACCUM_CONV (unsigned long long _Accum, ullk); + + NEG_CONV (short _Fract, hr); + NEG_CONV (_Fract, r); + NEG_CONV (long _Fract, lr); + NEG_CONV (long long _Fract, llr); + NEG_CONV (short _Accum, hk); + NEG_CONV (_Accum, k); + NEG_CONV (long _Accum, lk); + NEG_CONV (long long _Accum, llk); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/fixed-point/convert-float-1.c b/gcc/testsuite/gcc.dg/fixed-point/convert-float-1.c new file mode 100644 index 00000000000..b36adab570a --- /dev/null +++ b/gcc/testsuite/gcc.dg/fixed-point/convert-float-1.c @@ -0,0 +1,20 @@ +/* { dg-do run } */ +/* { dg-options "-std=gnu99 -O0" } */ + +/* C99 6.3 Conversions. + + Check conversions involving fixed-point. */ + +extern void abort (void); + +#include "convert.h" + +int main () +{ + ALL_CONV_FLOAT (short _Fract, hr); + ALL_CONV_FLOAT (_Fract, r); + ALL_CONV_FLOAT (long _Fract, lr); + ALL_CONV_FLOAT (long long _Fract, llr); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/fixed-point/convert-float-2.c b/gcc/testsuite/gcc.dg/fixed-point/convert-float-2.c new file mode 100644 index 00000000000..2a3f3e95a1b --- /dev/null +++ b/gcc/testsuite/gcc.dg/fixed-point/convert-float-2.c @@ -0,0 +1,20 @@ +/* { dg-do run } */ +/* { dg-options "-std=gnu99 -O0" } */ + +/* C99 6.3 Conversions. + + Check conversions involving fixed-point. */ + +extern void abort (void); + +#include "convert.h" + +int main () +{ + ALL_CONV_FLOAT (unsigned short _Fract, uhr); + ALL_CONV_FLOAT (unsigned _Fract, ur); + ALL_CONV_FLOAT (unsigned long _Fract, ulr); + ALL_CONV_FLOAT (unsigned long long _Fract, ullr); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/fixed-point/convert-float-3.c b/gcc/testsuite/gcc.dg/fixed-point/convert-float-3.c new file mode 100644 index 00000000000..9cad010912f --- /dev/null +++ b/gcc/testsuite/gcc.dg/fixed-point/convert-float-3.c @@ -0,0 +1,20 @@ +/* { dg-do run } */ +/* { dg-options "-std=gnu99 -O0" } */ + +/* C99 6.3 Conversions. + + Check conversions involving fixed-point. */ + +extern void abort (void); + +#include "convert.h" + +int main () +{ + ALL_CONV_FLOAT (short _Accum, hk); + ALL_CONV_FLOAT (_Accum, k); + ALL_CONV_FLOAT (long _Accum, lk); + ALL_CONV_FLOAT (long long _Accum, llk); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/fixed-point/convert-float-4.c b/gcc/testsuite/gcc.dg/fixed-point/convert-float-4.c new file mode 100644 index 00000000000..c25a55c0715 --- /dev/null +++ b/gcc/testsuite/gcc.dg/fixed-point/convert-float-4.c @@ -0,0 +1,20 @@ +/* { dg-do run } */ +/* { dg-options "-std=gnu99 -O0" } */ + +/* C99 6.3 Conversions. + + Check conversions involving fixed-point. */ + +extern void abort (void); + +#include "convert.h" + +int main () +{ + ALL_CONV_FLOAT (unsigned short _Accum, uhk); + ALL_CONV_FLOAT (unsigned _Accum, uk); + ALL_CONV_FLOAT (unsigned long _Accum, ulk); + ALL_CONV_FLOAT (unsigned long long _Accum, ullk); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/fixed-point/convert-sat.c b/gcc/testsuite/gcc.dg/fixed-point/convert-sat.c new file mode 100644 index 00000000000..278aa173b65 --- /dev/null +++ b/gcc/testsuite/gcc.dg/fixed-point/convert-sat.c @@ -0,0 +1,45 @@ +/* { dg-do run } */ +/* { dg-options "-std=gnu99 -O0" } */ + +/* C99 6.3 Conversions. + + Check conversions involving fixed-point. */ + +extern void abort (void); + +#include "convert.h" + +int main () +{ + SAT_CONV1 (short _Accum, hk); + SAT_CONV1 (_Accum, k); + SAT_CONV1 (long _Accum, lk); + SAT_CONV1 (long long _Accum, llk); + + SAT_CONV2 (unsigned short _Accum, uhk); + SAT_CONV2 (unsigned _Accum, uk); + SAT_CONV2 (unsigned long _Accum, ulk); + SAT_CONV2 (unsigned long long _Accum, ullk); + + SAT_CONV3 (short _Fract, hr); + SAT_CONV3 (_Fract, r); + SAT_CONV3 (long _Fract, lr); + SAT_CONV3 (long long _Fract, llr); + + SAT_CONV4 (signed char); + SAT_CONV4 (short); + SAT_CONV4 (int); + SAT_CONV4 (long); + SAT_CONV4 (long long); + + SAT_CONV5 (unsigned char); + SAT_CONV5 (unsigned short); + SAT_CONV5 (unsigned int); + SAT_CONV5 (unsigned long); + SAT_CONV5 (unsigned long long); + + SAT_CONV6 (float); + SAT_CONV6 (double); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/fixed-point/convert.c b/gcc/testsuite/gcc.dg/fixed-point/convert.h similarity index 87% rename from gcc/testsuite/gcc.dg/fixed-point/convert.c rename to gcc/testsuite/gcc.dg/fixed-point/convert.h index f4e373f2d60..e4e68157a77 100644 --- a/gcc/testsuite/gcc.dg/fixed-point/convert.c +++ b/gcc/testsuite/gcc.dg/fixed-point/convert.h @@ -1,11 +1,6 @@ -/* { dg-do run } */ -/* { dg-options "-std=gnu99 -O0" } */ - -/* C99 6.3 Conversions. - - Check conversions involving fixed-point. */ - -extern void abort (void); +/* Check conversions involving fixed-point. + * Break up use-site into into manageable parts so that even embedded + * targets with restrictive resources can run them. */ /* Fixed-point to fixed-point. */ #define CONV(TYPE1,POSTFIX1,TYPE2,POSTFIX2) \ @@ -131,7 +126,7 @@ extern void abort (void); CONV(_Sat TYPE, POSTFIX, unsigned _Accum, uk) \ CONV(_Sat TYPE, POSTFIX, unsigned long _Accum, ulk) \ CONV(_Sat TYPE, POSTFIX, unsigned long long _Accum, ullk) \ - CONV(TYPE, POSTFIX, _Sat short _Fract, hr) \ + CONV(TYPE, POSTFIX, _Sat short _Fract, hr) \ CONV(TYPE, POSTFIX, _Sat _Fract, r) \ CONV(TYPE, POSTFIX, _Sat long _Fract, lr) \ CONV(TYPE, POSTFIX, _Sat long long _Fract, llr) \ @@ -147,7 +142,7 @@ extern void abort (void); CONV(TYPE, POSTFIX, _Sat unsigned _Accum, uk) \ CONV(TYPE, POSTFIX, _Sat unsigned long _Accum, ulk) \ CONV(TYPE, POSTFIX, _Sat unsigned long long _Accum, ullk) \ - CONV_INT(TYPE, POSTFIX, signed char) \ + CONV_INT(TYPE, POSTFIX, signed char) \ CONV_INT(TYPE, POSTFIX, short) \ CONV_INT(TYPE, POSTFIX, int) \ CONV_INT(TYPE, POSTFIX, long) \ @@ -166,8 +161,10 @@ extern void abort (void); CONV_INT(_Sat TYPE, POSTFIX, unsigned short) \ CONV_INT(_Sat TYPE, POSTFIX, unsigned int) \ CONV_INT(_Sat TYPE, POSTFIX, unsigned long) \ - CONV_INT(_Sat TYPE, POSTFIX, unsigned long long) \ - CONV_FLOAT(TYPE, POSTFIX, float) \ + CONV_INT(_Sat TYPE, POSTFIX, unsigned long long) + +#define ALL_CONV_FLOAT(TYPE,POSTFIX) \ + CONV_FLOAT(TYPE, POSTFIX, float) \ CONV_FLOAT(TYPE, POSTFIX, double) \ CONV_FLOAT(_Sat TYPE, POSTFIX, float) \ CONV_FLOAT(_Sat TYPE, POSTFIX, double) @@ -360,73 +357,3 @@ extern void abort (void); CONV2(TYPE, -1.0, _Sat unsigned long _Fract, 0.0ulr) \ CONV2(TYPE, 1.0, _Sat unsigned long long _Fract, 1.0ullr) \ CONV2(TYPE, -1.0, _Sat unsigned long long _Fract, 0.0ullr) - -int main () -{ - ALL_CONV (short _Fract, hr); - ALL_CONV (_Fract, r); - ALL_CONV (long _Fract, lr); - ALL_CONV (long long _Fract, llr); - ALL_CONV (unsigned short _Fract, uhr); - ALL_CONV (unsigned _Fract, ur); - ALL_CONV (unsigned long _Fract, ulr); - ALL_CONV (unsigned long long _Fract, ullr); - ALL_CONV (short _Accum, hk); - ALL_CONV (_Accum, k); - ALL_CONV (long _Accum, lk); - ALL_CONV (long long _Accum, llk); - ALL_CONV (unsigned short _Accum, uhk); - ALL_CONV (unsigned _Accum, uk); - ALL_CONV (unsigned long _Accum, ulk); - ALL_CONV (unsigned long long _Accum, ullk); - - ALL_ACCUM_CONV (short _Accum, hk); - ALL_ACCUM_CONV (_Accum, k); - ALL_ACCUM_CONV (long _Accum, lk); - ALL_ACCUM_CONV (long long _Accum, llk); - ALL_ACCUM_CONV (unsigned short _Accum, uhk); - ALL_ACCUM_CONV (unsigned _Accum, uk); - ALL_ACCUM_CONV (unsigned long _Accum, ulk); - ALL_ACCUM_CONV (unsigned long long _Accum, ullk); - - NEG_CONV (short _Fract, hr); - NEG_CONV (_Fract, r); - NEG_CONV (long _Fract, lr); - NEG_CONV (long long _Fract, llr); - NEG_CONV (short _Accum, hk); - NEG_CONV (_Accum, k); - NEG_CONV (long _Accum, lk); - NEG_CONV (long long _Accum, llk); - - SAT_CONV1 (short _Accum, hk); - SAT_CONV1 (_Accum, k); - SAT_CONV1 (long _Accum, lk); - SAT_CONV1 (long long _Accum, llk); - - SAT_CONV2 (unsigned short _Accum, uhk); - SAT_CONV2 (unsigned _Accum, uk); - SAT_CONV2 (unsigned long _Accum, ulk); - SAT_CONV2 (unsigned long long _Accum, ullk); - - SAT_CONV3 (short _Fract, hr); - SAT_CONV3 (_Fract, r); - SAT_CONV3 (long _Fract, lr); - SAT_CONV3 (long long _Fract, llr); - - SAT_CONV4 (signed char); - SAT_CONV4 (short); - SAT_CONV4 (int); - SAT_CONV4 (long); - SAT_CONV4 (long long); - - SAT_CONV5 (unsigned char); - SAT_CONV5 (unsigned short); - SAT_CONV5 (unsigned int); - SAT_CONV5 (unsigned long); - SAT_CONV5 (unsigned long long); - - SAT_CONV6 (float); - SAT_CONV6 (double); - - return 0; -}