diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2012-11-16 08:51:43 +0100 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2012-11-16 08:51:43 +0100 |
commit | 589f95d610c24eff5d996442e44cb3a7bb5dd8ea (patch) | |
tree | 96f51500bef661a5467b5f2359018ff935073b55 | |
parent | 5756eff74e6746100631da64ab91d0ba39ebb0cb (diff) | |
download | gcc-589f95d610c24eff5d996442e44cb3a7bb5dd8ea.zip gcc-589f95d610c24eff5d996442e44cb3a7bb5dd8ea.tar.gz gcc-589f95d610c24eff5d996442e44cb3a7bb5dd8ea.tar.bz2 |
* lib/target_suports.exp
(check_effective_target_has_w_floating_suffix): New procedure.
(check_effective_target_has_q_floating_suffix): Ditto.
* g++.dg/cpp0x/gnu_fext-numeric-literals.C: Add dg-error directive
for unsupported non-standard suffix on floating constant.
* g++.dg/cpp0x/std_fext-numeric-literals.C: Ditto.
From-SVN: r193551
-rw-r--r-- | gcc/testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/gnu_fext-numeric-literals.C | 8 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/std_fext-numeric-literals.C | 8 | ||||
-rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 17 |
4 files changed, 34 insertions, 8 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7b18ff1..8851fdb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2012-11-15 Uros Bizjak <ubizjak@gmail.com> + + * lib/target_suports.exp + (check_effective_target_has_w_floating_suffix): New procedure. + (check_effective_target_has_q_floating_suffix): Ditto. + * g++.dg/cpp0x/gnu_fext-numeric-literals.C: Add dg-error directive + for unsupported non-standard suffix on floating constant. + * g++.dg/cpp0x/std_fext-numeric-literals.C: Ditto. + 2012-11-14 Jakub Jelinek <jakub@redhat.com> * lib/asan-dg.exp: New file. diff --git a/gcc/testsuite/g++.dg/cpp0x/gnu_fext-numeric-literals.C b/gcc/testsuite/g++.dg/cpp0x/gnu_fext-numeric-literals.C index f4ccd26..ad98db9f 100644 --- a/gcc/testsuite/g++.dg/cpp0x/gnu_fext-numeric-literals.C +++ b/gcc/testsuite/g++.dg/cpp0x/gnu_fext-numeric-literals.C @@ -91,10 +91,10 @@ main() auto rfp = 1.0r; // { dg-error "fixed-point types not supported" } auto Rfp = 1.0R; // { dg-error "fixed-point types not supported" } - auto wfp = 1.0w; - auto Wfp = 1.0W; - auto qfp = 1.0q; - auto Qfp = 1.0Q; + auto wfp = 1.0w; // { dg-error "unsupported" "" { target { ! has_w_floating_suffix } } } + auto Wfp = 1.0W; // { dg-error "unsupported" "" { target { ! has_w_floating_suffix } } } + auto qfp = 1.0q; // { dg-error "unsupported" "" { target { ! has_q_floating_suffix } } } + auto Qfp = 1.0Q; // { dg-error "unsupported" "" { target { ! has_q_floating_suffix } } } } // { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 7 } diff --git a/gcc/testsuite/g++.dg/cpp0x/std_fext-numeric-literals.C b/gcc/testsuite/g++.dg/cpp0x/std_fext-numeric-literals.C index d59c181..e71cdc5 100644 --- a/gcc/testsuite/g++.dg/cpp0x/std_fext-numeric-literals.C +++ b/gcc/testsuite/g++.dg/cpp0x/std_fext-numeric-literals.C @@ -91,10 +91,10 @@ main() auto rfp = 1.0r; // { dg-error "fixed-point types not supported" } auto Rfp = 1.0R; // { dg-error "fixed-point types not supported" } - auto wfp = 1.0w; - auto Wfp = 1.0W; - auto qfp = 1.0q; - auto Qfp = 1.0Q; + auto wfp = 1.0w; // { dg-error "unsupported" "" { target { ! has_w_floating_suffix } } } + auto Wfp = 1.0W; // { dg-error "unsupported" "" { target { ! has_w_floating_suffix } } } + auto qfp = 1.0q; // { dg-error "unsupported" "" { target { ! has_q_floating_suffix } } } + auto Qfp = 1.0Q; // { dg-error "unsupported" "" { target { ! has_q_floating_suffix } } } } // { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 7 } diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index dd3a75a..184e161 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1742,6 +1742,23 @@ proc check_effective_target_double64plus { } { }] } +# Return 1 if the target supports 'w' suffix on floating constant +# 0 otherwise. + +proc check_effective_target_has_w_floating_suffix { } { + return [check_no_compiler_messages w_fp_suffix object { + float dummy = 1.0w; + } "-std=gnu++03 -w"] +} + +# Return 1 if the target supports 'q' suffix on floating constant +# 0 otherwise. + +proc check_effective_target_has_q_floating_suffix { } { + return [check_no_compiler_messages q_fp_suffix object { + float dummy = 1.0q; + } "-std=gnu++03 -w"] +} # Return 1 if the target supports compiling fixed-point, # 0 otherwise. |