OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [libstdc++-v3/] [testsuite/] [21_strings/] [basic_string/] [capacity/] [char/] [18654.cc] - Diff between revs 424 and 565

Show entire file | Details | Blame | View Log

Rev 424 Rev 565
Line 20... Line 20...
// 21.3.3 string capacity
// 21.3.3 string capacity
 
 
#include <string>
#include <string>
#include <testsuite_hooks.h>
#include <testsuite_hooks.h>
 
 
 
// { dg-options " -DSTR_MAX_SIZE=16" { target { or32-*-elf } } }
 
 
 
#ifndef STR_MAX_SIZE
 
#define STR_MAX_SIZE 20
 
#endif
 
 
// libstdc++/18654
// libstdc++/18654
void test01()
void test01()
{
{
  using namespace std;
  using namespace std;
  bool test __attribute__((unused)) = true;
  bool test __attribute__((unused)) = true;
Line 32... Line 38...
 
 
  // Our current implementation provides exact shrink-to-size
  // Our current implementation provides exact shrink-to-size
  // and shrink-to-fit (in the future, maybe this will change
  // and shrink-to-fit (in the future, maybe this will change
  // for short strings).
  // for short strings).
  const size_type minsize = 2 << 0;
  const size_type minsize = 2 << 0;
  const size_type maxsize = 2 << 20;
  const size_type maxsize = 2 << STR_MAX_SIZE;
  for (size_type i = minsize; i <= maxsize; i *= 2)
  for (size_type i = minsize; i <= maxsize; i *= 2)
    {
    {
      string str(i, 'x');
      string str(i, 'x');
      str.reserve(3 * i);
      str.reserve(3 * i);
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.