diff options
author | Janis Johnson <janis187@us.ibm.com> | 2009-04-01 17:04:42 +0000 |
---|---|---|
committer | Janis Johnson <janis@gcc.gnu.org> | 2009-04-01 17:04:42 +0000 |
commit | eec49116064299fcd6ce9a1fbc0e45b914f14a15 (patch) | |
tree | 03c9e0cc5126cdeaeacf71743476447cbfcfadbc /gcc | |
parent | c4e751024524920e060b1c2fcbcc15423d86ac2c (diff) | |
download | gcc-eec49116064299fcd6ce9a1fbc0e45b914f14a15.zip gcc-eec49116064299fcd6ce9a1fbc0e45b914f14a15.tar.gz gcc-eec49116064299fcd6ce9a1fbc0e45b914f14a15.tar.bz2 |
re PR c/33466 (mixed-case suffix for decimal float constants)
libcpp/
PR c/33466
* expr.c (interpret_float_suffix): Reject invalid suffix that uses
letters from decimal float and fixed-point suffixes.
gcc/testsuite
PR c/33466
* gcc.dg/cpp/pr33466.c: New test.
* gcc.dg/dfp/pr33466.c: New test.
* gcc.dg/fixed-point/pr33466.c: New test.
From-SVN: r145417
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/pr33466.c | 64 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/dfp/pr33466.c | 14 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/fixed-point/pr33466.c | 34 |
4 files changed, 119 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 77df8ab..3723cb7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2009-04-01 Janis Johnson <janis187@us.ibm.com> + + PR c/33466 + * gcc.dg/cpp/pr33466.c: New test. + * gcc.dg/dfp/pr33466.c: New test. + * gcc.dg/fixed-point/pr33466.c: New test. + 2009-04-01 H.J. Lu <hongjiu.lu@intel.com> PR tree-optimization/35011 diff --git a/gcc/testsuite/gcc.dg/cpp/pr33466.c b/gcc/testsuite/gcc.dg/cpp/pr33466.c new file mode 100644 index 0000000..8ddb37c --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/pr33466.c @@ -0,0 +1,64 @@ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99" } */ + +/* Test various invalid constant float suffixes made up of letters of + valid suffixes. These are invalid regardless of whether the target + compiler supports decimal float or fixed-point types. */ + +long double rh = 0.5rh; /* { dg-error "invalid suffix" } */ +long double rl = 0.5rl; /* { dg-error "invalid suffix" } */ +long double rll = 0.5rll; /* { dg-error "invalid suffix" } */ +long double kh = 0.5kh; /* { dg-error "invalid suffix" } */ +long double kl = 0.5kl; /* { dg-error "invalid suffix" } */ +long double kll = 0.5kll; /* { dg-error "invalid suffix" } */ +long double ru = 0.5ru; /* { dg-error "invalid suffix" } */ +long double urh = 0.5urh; /* { dg-error "invalid suffix" } */ +long double hur = 0.5hur; /* { dg-error "invalid suffix" } */ +long double hru = 0.5hru; /* { dg-error "invalid suffix" } */ +long double ruh = 0.5ruh; /* { dg-error "invalid suffix" } */ +long double rhu = 0.5rhu; /* { dg-error "invalid suffix" } */ +long double url = 0.5url; /* { dg-error "invalid suffix" } */ +long double lur = 0.5lur; /* { dg-error "invalid suffix" } */ +long double lru = 0.5lru; /* { dg-error "invalid suffix" } */ +long double rul = 0.5rul; /* { dg-error "invalid suffix" } */ +long double rlu = 0.5rlu; /* { dg-error "invalid suffix" } */ +long double urll = 0.5urll; /* { dg-error "invalid suffix" } */ +long double llur = 0.5llur; /* { dg-error "invalid suffix" } */ +long double llru = 0.5llru; /* { dg-error "invalid suffix" } */ +long double rull = 0.5rull; /* { dg-error "invalid suffix" } */ +long double rllu = 0.5rllu; /* { dg-error "invalid suffix" } */ +long double ku = 0.5ku; /* { dg-error "invalid suffix" } */ +long double ukh = 0.5ukh; /* { dg-error "invalid suffix" } */ +long double huk = 0.5huk; /* { dg-error "invalid suffix" } */ +long double hku = 0.5hku; /* { dg-error "invalid suffix" } */ +long double kuh = 0.5kuh; /* { dg-error "invalid suffix" } */ +long double khu = 0.5khu; /* { dg-error "invalid suffix" } */ +long double ukl = 0.5ukl; /* { dg-error "invalid suffix" } */ +long double luk = 0.5luk; /* { dg-error "invalid suffix" } */ +long double lku = 0.5lku; /* { dg-error "invalid suffix" } */ +long double kul = 0.5kul; /* { dg-error "invalid suffix" } */ +long double klu = 0.5klu; /* { dg-error "invalid suffix" } */ +long double ukll = 0.5ukll; /* { dg-error "invalid suffix" } */ +long double lluk = 0.5lluk; /* { dg-error "invalid suffix" } */ +long double llku = 0.5llku; /* { dg-error "invalid suffix" } */ +long double kull = 0.5kull; /* { dg-error "invalid suffix" } */ +long double kllu = 0.5kllu; /* { dg-error "invalid suffix" } */ +long double ld = 0.5ld; /* { dg-error "invalid suffix" } */ +long double fd = 0.5fd; /* { dg-error "invalid suffix" } */ +long double dk = 0.5dk; /* { dg-error "invalid suffix" } */ +long double dr = 0.5dr; /* { dg-error "invalid suffix" } */ +long double ddw = 0.5ddw; /* { dg-error "invalid suffix" } */ +long double ddq = 0.5ddq; /* { dg-error "invalid suffix" } */ +long double ddl = 0.5ddl; /* { dg-error "invalid suffix" } */ +long double ddf = 0.5ddf; /* { dg-error "invalid suffix" } */ +long double ddd = 0.5ddd; /* { dg-error "invalid suffix" } */ +long double dw = 0.5dw; /* { dg-error "invalid suffix" } */ +long double dq = 0.5dq; /* { dg-error "invalid suffix" } */ +long double wd = 0.5wd; /* { dg-error "invalid suffix" } */ +long double qd = 0.5qd; /* { dg-error "invalid suffix" } */ +long double wdd = 0.5wdd; /* { dg-error "invalid suffix" } */ +long double qdd = 0.5qdd; /* { dg-error "invalid suffix" } */ +long double ldd = 0.5ldd; /* { dg-error "invalid suffix" } */ +long double fdd = 0.5fdd; /* { dg-error "invalid suffix" } */ +long double ddi = 0.5ddi; /* { dg-error "invalid suffix" } */ +long double idd = 0.5idd; /* { dg-error "invalid suffix" } */ diff --git a/gcc/testsuite/gcc.dg/dfp/pr33466.c b/gcc/testsuite/gcc.dg/dfp/pr33466.c new file mode 100644 index 0000000..c8ac111 --- /dev/null +++ b/gcc/testsuite/gcc.dg/dfp/pr33466.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99" } */ + +/* The suffix for a decimal float constant must use a single case. + + These are invalid for all targets, not just those that support + decimal float. */ + +long double dF = 4.5dF; /* { dg-error "invalid suffix" } */ +long double Df = 4.5Df; /* { dg-error "invalid suffix" } */ +long double dD = 4.5dD; /* { dg-error "invalid suffix" } */ +long double Dd = 4.5Dd; /* { dg-error "invalid suffix" } */ +long double dL = 4.5dL; /* { dg-error "invalid suffix" } */ +long double Dl = 4.5Dl; /* { dg-error "invalid suffix" } */ diff --git a/gcc/testsuite/gcc.dg/fixed-point/pr33466.c b/gcc/testsuite/gcc.dg/fixed-point/pr33466.c new file mode 100644 index 0000000..196db31 --- /dev/null +++ b/gcc/testsuite/gcc.dg/fixed-point/pr33466.c @@ -0,0 +1,34 @@ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99" } */ + +/* The suffix for a fixed-point constant must use a specific order + for the pieces, and a long long length specifier must use the + same case (ll or LL). + + These are invalid for all targets, not just those that support + fixed-point types. */ + +long double lLr = 0.5lLr; /* { dg-error "invalid suffix" } */ +long double lLR = 0.5lLR; /* { dg-error "invalid suffix" } */ +long double Llr = 0.5Llr; /* { dg-error "invalid suffix" } */ +long double LlR = 0.5LlR; /* { dg-error "invalid suffix" } */ +long double ulLr = 0.5ulLr; /* { dg-error "invalid suffix" } */ +long double ulLR = 0.5ulLR; /* { dg-error "invalid suffix" } */ +long double uLlr = 0.5uLlr; /* { dg-error "invalid suffix" } */ +long double uLlR = 0.5uLlR; /* { dg-error "invalid suffix" } */ +long double UlLr = 0.5UlLr; /* { dg-error "invalid suffix" } */ +long double UlLR = 0.5UlLR; /* { dg-error "invalid suffix" } */ +long double ULlr = 0.5ULlr; /* { dg-error "invalid suffix" } */ +long double ULlR = 0.5ULlR; /* { dg-error "invalid suffix" } */ +long double lLk = 0.5lLk; /* { dg-error "invalid suffix" } */ +long double lLK = 0.5lLK; /* { dg-error "invalid suffix" } */ +long double Llk = 0.5Llk; /* { dg-error "invalid suffix" } */ +long double LlK = 0.5LlK; /* { dg-error "invalid suffix" } */ +long double ulLk = 0.5ulLk; /* { dg-error "invalid suffix" } */ +long double ulLK = 0.5ulLK; /* { dg-error "invalid suffix" } */ +long double uLlk = 0.5uLlk; /* { dg-error "invalid suffix" } */ +long double uLlK = 0.5uLlK; /* { dg-error "invalid suffix" } */ +long double UlLk = 0.5UlLk; /* { dg-error "invalid suffix" } */ +long double UlLK = 0.5UlLK; /* { dg-error "invalid suffix" } */ +long double ULlk = 0.5ULlk; /* { dg-error "invalid suffix" } */ +long double ULlK = 0.5ULlK; /* { dg-error "invalid suffix" } */ |