https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88859

--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> ---
[hjl@gnu-skx-1 pr88859]$ cat x.cc 
#include <experimental/string_view>

#define VERIFY(fn) if (!(fn)) __builtin_abort();

int
main() 
{
  std::experimental::wstring_view       str_0(L"costa rica");
  std::experimental::wstring_view       str_1(L"costa marbella");
  std::experimental::wstring_view       str_2(L"cost");
  std::experimental::wstring_view       str_3(L"costa ricans");
  std::experimental::wstring_view  str_4;

  str_4 = str_0;
  VERIFY( !(str_0 == str_1) );
  VERIFY( !(str_0 == str_2) );
  VERIFY( !(str_0 == str_3) );
  VERIFY( !(str_1 == str_0) );
  VERIFY( !(str_2 == str_0) );
  VERIFY( !(str_3 == str_0) );
  VERIFY( str_4 == str_0 );
  VERIFY( str_0 == str_4 );

  VERIFY( !(str_0 == L"costa marbella") );
  VERIFY( !(str_0 == L"cost") );
  VERIFY( !(str_0 == L"costa ricans") );
  VERIFY( !(L"cost" == str_0) );
  VERIFY( !(L"costa ricans" == str_0) );
  VERIFY( L"costa rica" == str_0 );
  VERIFY( str_0 == L"costa rica" );

  VERIFY( L"costa ricans" != str_0 );
  VERIFY( !(L"costa rica" != str_0) );

  return 0;
}
[hjl@gnu-skx-1 pr88859]$ make
g++ -O2 -mx32 -S x.cc
g++ -O2 -mx32 -o x x.s
./x
make: *** [Makefile:12: all] Segmentation fault
[hjl@gnu-skx-1 pr88859]$

Reply via email to