diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2019-01-04 11:06:49 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2019-01-04 11:06:49 +0000 |
commit | 5db78cac104c0427b023b3a21f98bf302aa736e3 (patch) | |
tree | 1aa8cf0cfa86b0e9b326bd8b1ac68a8d3be4f54e /libstdc++-v3 | |
parent | a52fcfac0a9621e4ee5345272873d96f55ad3d18 (diff) | |
download | gcc-5db78cac104c0427b023b3a21f98bf302aa736e3.zip gcc-5db78cac104c0427b023b3a21f98bf302aa736e3.tar.gz gcc-5db78cac104c0427b023b3a21f98bf302aa736e3.tar.bz2 |
Avoid spurious test failures when -fno-inline in test flags
These tests rely on inlining, so if -fno-inline is added to the compiler
flags the tests fail. Use the predefined __NO_INLINE__ macro to detect
that situation, and don't bother testing the move assignment.
* testsuite/21_strings/basic_string/modifiers/assign/char/
move_assign_optim.cc: Avoid spurious failure when -fno-inline added
to test flags.
* testsuite/21_strings/basic_string/modifiers/assign/wchar_t/
move_assign_optim.cc: Likewise.
From-SVN: r267573
Diffstat (limited to 'libstdc++-v3')
3 files changed, 14 insertions, 2 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 76fc247..e6a2dc2 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2019-01-04 Jonathan Wakely <jwakely@redhat.com> + + * testsuite/21_strings/basic_string/modifiers/assign/char/ + move_assign_optim.cc: Avoid spurious failure when -fno-inline added + to test flags. + * testsuite/21_strings/basic_string/modifiers/assign/wchar_t/ + move_assign_optim.cc: Likewise. + 2019-01-03 Jonathan Wakely <jwakely@redhat.com> Jakub Jelinek <jakub@redhat.com> diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/assign/char/move_assign_optim.cc b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/assign/char/move_assign_optim.cc index 6ac54b5..bbe60e5 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/assign/char/move_assign_optim.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/assign/char/move_assign_optim.cc @@ -30,6 +30,8 @@ test01(std::string& target, std::string&& source) // The move assignment operator should be simple enough that the compiler // can see that it never results in a length_error or bad_alloc exception // (which would be turned into std::terminate by the noexcept on the - // assignment operator). + // assignment operator). This is only true when inlining though. +#ifndef __NO_INLINE__ target = std::move(source); +#endif } diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/assign/wchar_t/move_assign_optim.cc b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/assign/wchar_t/move_assign_optim.cc index 261c664..15f3a4b 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/assign/wchar_t/move_assign_optim.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/assign/wchar_t/move_assign_optim.cc @@ -30,6 +30,8 @@ test01(std::wstring& target, std::wstring&& source) // The move assignment operator should be simple enough that the compiler // can see that it never results in a length_error or bad_alloc exception // (which would be turned into std::terminate by the noexcept on the - // assignment operator). + // assignment operator). This is only true when inlining though. +#ifndef __NO_INLINE__ target = std::move(source); +#endif } |