URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Show entire file |
Details |
Blame |
View Log
Rev 424 |
Rev 565 |
Line 17... |
Line 17... |
// with this library; see the file COPYING3. If not see
|
// with this library; see the file COPYING3. If not see
|
// <http://www.gnu.org/licenses/>.
|
// <http://www.gnu.org/licenses/>.
|
|
|
// 21.3.3 string capacity
|
// 21.3.3 string capacity
|
|
|
|
// { dg-options " -DSTR_MAX_SIZE=16" { target { or32-*-elf } } }
|
|
|
|
#ifndef STR_MAX_SIZE
|
|
#define STR_MAX_SIZE 20
|
|
#endif
|
|
|
#include <string>
|
#include <string>
|
#include <testsuite_hooks.h>
|
#include <testsuite_hooks.h>
|
|
|
// libstdc++/18654
|
// libstdc++/18654
|
void test01()
|
void test01()
|
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)
|
{
|
{
|
wstring str(i, L'x');
|
wstring str(i, L'x');
|
str.reserve(3 * i);
|
str.reserve(3 * i);
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.