From: Jakub Jelinek Date: Sun, 2 Oct 2016 19:32:45 +0000 (+0200) Subject: asm3.C (two): Only use register keyword for C++14 and earlier. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2c8e3a1d9996d8e1859af476d97655aad5368eff;p=gcc.git asm3.C (two): Only use register keyword for C++14 and earlier. * g++.dg/ext/asm3.C (two): Only use register keyword for C++14 and earlier. * g++.dg/charset/asm2.c (memmove): Likewise. * g++.dg/tls/diag-2.C (foo): Expect -Wregister error for C++17. * g++.dg/tls/diag-4.C (foo): Likewise. * c-c++-common/vector-subscript-2.c (vf): Change dg-error to dg-warning, fix up regex. * g++.old-deja/g++.brendan/warnings4.C: Limit to c++14_down targets. * g++.old-deja/g++.mike/p700.C: Add -Wno-register. * g++.old-deja/g++.mike/net31.C: Likewise. * g++.old-deja/g++.other/regstack.C (foo): Expect -Wregister warning for C++17. * g++.old-deja/g++.jason/enum3.C: Add -Wno-register. * g++.old-deja/g++.eh/ia64-1.C: Likewise. From-SVN: r240702 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6e5820347da..54de56f8f3c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,20 @@ +2016-10-02 Jakub Jelinek + + * g++.dg/ext/asm3.C (two): Only use register keyword for C++14 and + earlier. + * g++.dg/charset/asm2.c (memmove): Likewise. + * g++.dg/tls/diag-2.C (foo): Expect -Wregister error for C++17. + * g++.dg/tls/diag-4.C (foo): Likewise. + * c-c++-common/vector-subscript-2.c (vf): Change dg-error to + dg-warning, fix up regex. + * g++.old-deja/g++.brendan/warnings4.C: Limit to c++14_down targets. + * g++.old-deja/g++.mike/p700.C: Add -Wno-register. + * g++.old-deja/g++.mike/net31.C: Likewise. + * g++.old-deja/g++.other/regstack.C (foo): Expect -Wregister warning + for C++17. + * g++.old-deja/g++.jason/enum3.C: Add -Wno-register. + * g++.old-deja/g++.eh/ia64-1.C: Likewise. + 2016-10-01 Richard Biener PR middle-end/77798 diff --git a/gcc/testsuite/c-c++-common/vector-subscript-2.c b/gcc/testsuite/c-c++-common/vector-subscript-2.c index e7bd251e060..bfe01fc2740 100644 --- a/gcc/testsuite/c-c++-common/vector-subscript-2.c +++ b/gcc/testsuite/c-c++-common/vector-subscript-2.c @@ -7,6 +7,6 @@ float vf(int i) { - register vector float a; // { dg-error "ISO C++1z does not allow 'register' storage class specifier" "" { target c++1z } } + register vector float a; // { dg-warning "ISO C\\+\\+1z does not allow 'register' storage class specifier" "" { target c++1z } } return a[0]; } diff --git a/gcc/testsuite/g++.dg/charset/asm2.c b/gcc/testsuite/g++.dg/charset/asm2.c index 7fb1959d260..3907d32fe86 100644 --- a/gcc/testsuite/g++.dg/charset/asm2.c +++ b/gcc/testsuite/g++.dg/charset/asm2.c @@ -10,7 +10,10 @@ void * memmove (void *__dest, __const void *__src, size_t __n) { - register unsigned long int __d0, __d1, __d2; +#if __cplusplus <= 201402L + register +#endif + unsigned long int __d0, __d1, __d2; if (__dest < __src) __asm__ __volatile__ ("cld\n\t" diff --git a/gcc/testsuite/g++.dg/ext/asm3.C b/gcc/testsuite/g++.dg/ext/asm3.C index 090218fe61f..0a0f837f0a7 100644 --- a/gcc/testsuite/g++.dg/ext/asm3.C +++ b/gcc/testsuite/g++.dg/ext/asm3.C @@ -7,9 +7,12 @@ int two(int in) { - register int out; +#if __cplusplus <= 201402L + register +#endif + int out; __asm__ ("" : "r" (out) : "r" (in)); return out; } -// { dg-message "error:" "" { target *-*-* } 11 } +// { dg-message "error:" "" { target *-*-* } 14 } diff --git a/gcc/testsuite/g++.dg/tls/diag-2.C b/gcc/testsuite/g++.dg/tls/diag-2.C index b5d02e7fe12..cc46245c1a3 100644 --- a/gcc/testsuite/g++.dg/tls/diag-2.C +++ b/gcc/testsuite/g++.dg/tls/diag-2.C @@ -12,7 +12,7 @@ void foo() auto __thread int l2; /* { dg-error "multiple storage classes|data types" } */ __thread extern int l3; /* { dg-error "'__thread' before 'extern'" } */ register __thread int l4; /* { dg-error "multiple storage classes" } */ -} +} /* { dg-error "ISO C\\+\\+1z does not allow 'register' storage class specifier" "" { target c++1z } .-1 } */ __thread void f1 (); /* { dg-error "invalid for function" } */ extern __thread void f2 (); /* { dg-error "invalid for function" } */ diff --git a/gcc/testsuite/g++.dg/tls/diag-4.C b/gcc/testsuite/g++.dg/tls/diag-4.C index 7d07d9deb2d..35440b9114f 100644 --- a/gcc/testsuite/g++.dg/tls/diag-4.C +++ b/gcc/testsuite/g++.dg/tls/diag-4.C @@ -7,4 +7,4 @@ void foo() { __thread auto int l2; /* { dg-error "multiple storage classes|data types" } */ __thread register int l4; /* { dg-error "multiple storage classes" } */ -} +} /* { dg-error "ISO C\\+\\+1z does not allow 'register' storage class specifier" "" { target c++1z } .-1 } */ diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/warnings4.C b/gcc/testsuite/g++.old-deja/g++.brendan/warnings4.C index 410ca800ce8..a0f7dde7a62 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/warnings4.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/warnings4.C @@ -1,4 +1,4 @@ -// { dg-do assemble } +// { dg-do assemble { target c++14_down } } // GROUPS passed warnings int main () diff --git a/gcc/testsuite/g++.old-deja/g++.eh/ia64-1.C b/gcc/testsuite/g++.old-deja/g++.eh/ia64-1.C index f8def11d6da..7767d342e0a 100644 --- a/gcc/testsuite/g++.old-deja/g++.eh/ia64-1.C +++ b/gcc/testsuite/g++.old-deja/g++.eh/ia64-1.C @@ -1,5 +1,5 @@ // { dg-do run } -// { dg-options "-O2" } +// { dg-options "-O2 -Wno-register" } #include diff --git a/gcc/testsuite/g++.old-deja/g++.jason/enum3.C b/gcc/testsuite/g++.old-deja/g++.jason/enum3.C index 04e8f287bc7..5c65413aea3 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/enum3.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/enum3.C @@ -1,5 +1,5 @@ // { dg-do assemble } -// { dg-options "-Wall" } +// { dg-options "-Wall -Wno-register" } enum tristate { no = -1, maybe, yes }; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net31.C b/gcc/testsuite/g++.old-deja/g++.mike/net31.C index 8bc159b136e..da54155f88a 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/net31.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/net31.C @@ -1,4 +1,5 @@ // { dg-do assemble } +// { dg-additional-options "-Wno-register" } class foo_a { protected: diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p700.C b/gcc/testsuite/g++.old-deja/g++.mike/p700.C index 1fef5c85549..531962197df 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/p700.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/p700.C @@ -1,5 +1,5 @@ // { dg-do assemble } -// { dg-options "-Wno-deprecated" } +// { dg-options "-Wno-deprecated -Wno-register" } // { dg-error "limited range of data type" "16-bit target" { target xstormy16-*-* } 0 } // prms-id: 700 diff --git a/gcc/testsuite/g++.old-deja/g++.other/regstack.C b/gcc/testsuite/g++.old-deja/g++.other/regstack.C index 5b833473332..90875cfcf5f 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/regstack.C +++ b/gcc/testsuite/g++.old-deja/g++.other/regstack.C @@ -3,7 +3,7 @@ inline double foo (double x) { - register double r; + register double r; // { dg-warning "ISO C\\+\\+1z does not allow 'register' storage class specifier" "" { target c++1z } } asm volatile ("fsqrt" : "=t" (r) : "0" (x)); return r; }