forked from OSchip/llvm-project
[libc++] Increase portability of xalloc test
Do not assume that xalloc() starts at 0, which is not specified by the Standard. Thanks to Andrey Maksimov for the patch. Differential Revision: https://reviews.llvm.org/D58299 llvm-svn: 355160
This commit is contained in:
parent
33634d1b25
commit
e90085029c
|
@ -17,11 +17,9 @@
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
assert(std::ios_base::xalloc() == 0);
|
||||
assert(std::ios_base::xalloc() == 1);
|
||||
assert(std::ios_base::xalloc() == 2);
|
||||
assert(std::ios_base::xalloc() == 3);
|
||||
assert(std::ios_base::xalloc() == 4);
|
||||
int index = std::ios_base::xalloc();
|
||||
for (int i = 0; i < 10000; ++i)
|
||||
assert(std::ios_base::xalloc() == ++index);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue