[libc++] Split off debug tests that were missed by ce1365f8f7 into test/libcxx
Also, some tests had multiple death tests in them, so split them into separate tests instead. The second death test would obviously never get run, because the first one would kill the program before.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_map>
|
||||
|
||||
// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
|
||||
// class Alloc = allocator<pair<const Key, T>>>
|
||||
// class unordered_map
|
||||
|
||||
// size_type bucket_size(size_type n) const
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_map<int, std::string> C;
|
||||
C c;
|
||||
(void) c.bucket_size(3);
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -21,14 +21,11 @@
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
typedef std::unordered_map<int, std::string> C;
|
||||
C c;
|
||||
(void) c.bucket(3);
|
||||
assert(false);
|
||||
}
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_map<int, std::string> C;
|
||||
C c;
|
||||
(void) c.bucket(3);
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -20,19 +20,16 @@
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
typedef std::unordered_map<double, int> C;
|
||||
typedef C::iterator R;
|
||||
typedef C::value_type P;
|
||||
C c;
|
||||
C c2;
|
||||
C::const_iterator e = c2.end();
|
||||
P v(3.5, 3);
|
||||
R r = c.insert(e, v);
|
||||
assert(false);
|
||||
}
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_map<double, int> C;
|
||||
typedef C::iterator R;
|
||||
typedef C::value_type P;
|
||||
C c;
|
||||
C c2;
|
||||
C::const_iterator e = c2.end();
|
||||
P v(3.5, 3);
|
||||
R r = c.insert(e, v);
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -24,18 +24,15 @@
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
typedef std::unordered_map<double, int> C;
|
||||
typedef C::iterator R;
|
||||
typedef C::value_type P;
|
||||
C c;
|
||||
C c2;
|
||||
C::const_iterator e = c2.end();
|
||||
R r = c.insert(e, P(3.5, 3));
|
||||
assert(false);
|
||||
}
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_map<double, int> C;
|
||||
typedef C::iterator R;
|
||||
typedef C::value_type P;
|
||||
C c;
|
||||
C c2;
|
||||
C::const_iterator e = c2.end();
|
||||
R r = c.insert(e, P(3.5, 3));
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_map>
|
||||
|
||||
// Dereference non-dereferenceable iterator.
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_map>
|
||||
#include <cassert>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
|
||||
min_allocator<std::pair<const int, std::string>>> C;
|
||||
C c;
|
||||
c.insert(std::make_pair(1, "one"));
|
||||
C::iterator i = c.end();
|
||||
C::value_type j = *i;
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -16,18 +16,13 @@
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_map<int, std::string> C;
|
||||
C c;
|
||||
c.insert(std::make_pair(1, "one"));
|
||||
@@ -36,18 +31,6 @@ int main(int, char**)
|
||||
assert(i == c.end());
|
||||
++i;
|
||||
assert(false);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
|
||||
min_allocator<std::pair<const int, std::string>>> C;
|
||||
C c;
|
||||
c.insert(std::make_pair(1, "one"));
|
||||
C::iterator i = c.begin();
|
||||
++i;
|
||||
assert(i == c.end());
|
||||
++i;
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -16,34 +16,19 @@
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_map<int, std::string> C;
|
||||
C c;
|
||||
c.insert(std::make_pair(1, "one"));
|
||||
C::iterator i = c.end();
|
||||
C::value_type j = *i;
|
||||
assert(false);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
|
||||
min_allocator<std::pair<const int, std::string>>> C;
|
||||
C c;
|
||||
c.insert(std::make_pair(1, "one"));
|
||||
C::iterator i = c.end();
|
||||
C::value_type j = *i;
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_map>
|
||||
|
||||
// Increment iterator past end.
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_map>
|
||||
#include <cassert>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
|
||||
min_allocator<std::pair<const int, std::string>>> C;
|
||||
C c;
|
||||
c.insert(std::make_pair(1, "one"));
|
||||
C::iterator i = c.begin();
|
||||
++i;
|
||||
assert(i == c.end());
|
||||
++i;
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_map>
|
||||
|
||||
// Dereference non-dereferenceable iterator.
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_map>
|
||||
#include <cassert>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
|
||||
min_allocator<std::pair<const int, std::string>>> C;
|
||||
C c(1);
|
||||
C::local_iterator i = c.end(0);
|
||||
C::value_type j = *i;
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -18,33 +18,16 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_map<int, std::string> C;
|
||||
C c(1);
|
||||
C::local_iterator i = c.begin(0);
|
||||
++i;
|
||||
++i;
|
||||
assert(false);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
|
||||
min_allocator<std::pair<const int, std::string>>> C;
|
||||
C c(1);
|
||||
C::local_iterator i = c.begin(0);
|
||||
++i;
|
||||
++i;
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -18,30 +18,15 @@
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_map<int, std::string> C;
|
||||
C c(1);
|
||||
C::local_iterator i = c.end(0);
|
||||
C::value_type j = *i;
|
||||
assert(false);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
|
||||
min_allocator<std::pair<const int, std::string>>> C;
|
||||
C c(1);
|
||||
C::local_iterator i = c.end(0);
|
||||
C::value_type j = *i;
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_map>
|
||||
|
||||
// Increment local_iterator past end.
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_map>
|
||||
#include <cassert>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
|
||||
min_allocator<std::pair<const int, std::string>>> C;
|
||||
C c(1);
|
||||
C::local_iterator i = c.begin(0);
|
||||
++i;
|
||||
++i;
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -22,17 +22,14 @@
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
std::unordered_map<int, int> s1 = {{1, 1}, {2, 2}, {3, 3}};
|
||||
std::unordered_map<int, int>::iterator i = s1.begin();
|
||||
std::pair<const int, int> k = *i;
|
||||
std::unordered_map<int, int> s2 = std::move(s1);
|
||||
assert(*i == k);
|
||||
s2.erase(i);
|
||||
assert(s2.size() == 2);
|
||||
}
|
||||
int main(int, char**) {
|
||||
std::unordered_map<int, int> s1 = {{1, 1}, {2, 2}, {3, 3}};
|
||||
std::unordered_map<int, int>::iterator i = s1.begin();
|
||||
std::pair<const int, int> k = *i;
|
||||
std::unordered_map<int, int> s2 = std::move(s1);
|
||||
assert(*i == k);
|
||||
s2.erase(i);
|
||||
assert(s2.size() == 2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -24,23 +24,20 @@
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
typedef std::pair<int, int> P;
|
||||
P a1[] = {P(1, 1), P(3, 3), P(7, 7), P(9, 9), P(10, 10)};
|
||||
P a2[] = {P(0, 0), P(2, 2), P(4, 4), P(5, 5), P(6, 6), P(8, 8), P(11, 11)};
|
||||
std::unordered_map<int, int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
|
||||
std::unordered_map<int, int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
|
||||
std::unordered_map<int, int>::iterator i1 = c1.begin();
|
||||
std::unordered_map<int, int>::iterator i2 = c2.begin();
|
||||
swap(c1, c2);
|
||||
c1.erase(i2);
|
||||
c2.erase(i1);
|
||||
std::unordered_map<int, int>::iterator j = i1;
|
||||
c1.erase(i1);
|
||||
assert(false);
|
||||
}
|
||||
int main(int, char**) {
|
||||
typedef std::pair<int, int> P;
|
||||
P a1[] = {P(1, 1), P(3, 3), P(7, 7), P(9, 9), P(10, 10)};
|
||||
P a2[] = {P(0, 0), P(2, 2), P(4, 4), P(5, 5), P(6, 6), P(8, 8), P(11, 11)};
|
||||
std::unordered_map<int, int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
|
||||
std::unordered_map<int, int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
|
||||
std::unordered_map<int, int>::iterator i1 = c1.begin();
|
||||
std::unordered_map<int, int>::iterator i2 = c2.begin();
|
||||
swap(c1, c2);
|
||||
c1.erase(i2);
|
||||
c2.erase(i1);
|
||||
std::unordered_map<int, int>::iterator j = i1;
|
||||
c1.erase(i1);
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_map>
|
||||
|
||||
// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
|
||||
// class Alloc = allocator<pair<const Key, T>>>
|
||||
// class unordered_map
|
||||
|
||||
// float max_load_factor() const;
|
||||
// void max_load_factor(float mlf);
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_map<int, std::string> C;
|
||||
C c;
|
||||
c.max_load_factor(0);
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -17,17 +17,17 @@
|
||||
|
||||
#include <unordered_map>
|
||||
#include <cassert>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef std::pair<int, int> P;
|
||||
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
|
||||
std::unordered_map<int, int> l1(a1, a1+3);
|
||||
std::unordered_map<int, int>::const_iterator i = l1.end();
|
||||
l1.erase(i);
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,14 +17,11 @@
|
||||
|
||||
#include <unordered_map>
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
#include <exception>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef std::pair<int, int> P;
|
||||
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
|
||||
std::unordered_map<int, int> l1(a1, a1+3);
|
||||
@@ -32,5 +29,6 @@ int main(int, char**)
|
||||
std::unordered_map<int, int>::const_iterator i = l2.begin();
|
||||
l1.erase(i);
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,19 +17,17 @@
|
||||
|
||||
#include <unordered_map>
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef std::pair<int, int> P;
|
||||
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
|
||||
std::unordered_map<int, int> l1(a1, a1+3);
|
||||
std::unordered_map<int, int> l2(a1, a1+3);
|
||||
std::unordered_map<int, int>::iterator i = l1.erase(l2.cbegin(), next(l1.cbegin()));
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,19 +17,17 @@
|
||||
|
||||
#include <unordered_map>
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef std::pair<int, int> P;
|
||||
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
|
||||
std::unordered_map<int, int> l1(a1, a1+3);
|
||||
std::unordered_map<int, int> l2(a1, a1+3);
|
||||
std::unordered_map<int, int>::iterator i = l1.erase(l1.cbegin(), next(l2.cbegin()));
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,19 +17,17 @@
|
||||
|
||||
#include <unordered_map>
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef std::pair<int, int> P;
|
||||
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
|
||||
std::unordered_map<int, int> l1(a1, a1+3);
|
||||
std::unordered_map<int, int> l2(a1, a1+3);
|
||||
std::unordered_map<int, int>::iterator i = l1.erase(l2.cbegin(), next(l2.cbegin()));
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,18 +17,16 @@
|
||||
|
||||
#include <unordered_map>
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef std::pair<int, int> P;
|
||||
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
|
||||
std::unordered_map<int, int> l1(a1, a1+3);
|
||||
std::unordered_map<int, int>::iterator i = l1.erase(next(l1.cbegin()), l1.cbegin());
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_map>
|
||||
|
||||
// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
|
||||
// class Alloc = allocator<pair<const Key, T>>>
|
||||
// class unordered_multimap
|
||||
|
||||
// size_type bucket(const key_type& __k) const;
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_multimap<int, std::string> C;
|
||||
C c;
|
||||
(void) c.bucket(3);
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_map>
|
||||
|
||||
// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
|
||||
// class Alloc = allocator<pair<const Key, T>>>
|
||||
// class unordered_multimap
|
||||
|
||||
// size_type bucket_size(size_type n) const
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_multimap<int, std::string> C;
|
||||
C c;
|
||||
(void) c.bucket_size(3);
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -20,19 +20,16 @@
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
typedef std::unordered_multimap<double, int> C;
|
||||
typedef C::iterator R;
|
||||
typedef C::value_type P;
|
||||
C c;
|
||||
C c2;
|
||||
C::const_iterator e = c2.end();
|
||||
P v(3.5, 3);
|
||||
R r = c.insert(e, v);
|
||||
assert(false);
|
||||
}
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_multimap<double, int> C;
|
||||
typedef C::iterator R;
|
||||
typedef C::value_type P;
|
||||
C c;
|
||||
C c2;
|
||||
C::const_iterator e = c2.end();
|
||||
P v(3.5, 3);
|
||||
R r = c.insert(e, v);
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -24,18 +24,15 @@
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
typedef std::unordered_multimap<double, int> C;
|
||||
typedef C::iterator R;
|
||||
typedef C::value_type P;
|
||||
C c;
|
||||
C c2;
|
||||
C::const_iterator e = c2.end();
|
||||
R r = c.insert(e, P(3.5, 3));
|
||||
assert(false);
|
||||
}
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_multimap<double, int> C;
|
||||
typedef C::iterator R;
|
||||
typedef C::value_type P;
|
||||
C c;
|
||||
C c2;
|
||||
C::const_iterator e = c2.end();
|
||||
R r = c.insert(e, P(3.5, 3));
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_map>
|
||||
|
||||
// Dereference non-dereferenceable iterator.
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <cassert>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
|
||||
min_allocator<std::pair<const int, std::string>>> C;
|
||||
C c;
|
||||
c.insert(std::make_pair(1, "one"));
|
||||
C::iterator i = c.end();
|
||||
C::value_type j = *i;
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -16,18 +16,13 @@
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_multimap<int, std::string> C;
|
||||
C c;
|
||||
c.insert(std::make_pair(1, "one"));
|
||||
@@ -36,18 +31,6 @@ int main(int, char**)
|
||||
assert(i == c.end());
|
||||
++i;
|
||||
assert(false);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
|
||||
min_allocator<std::pair<const int, std::string>>> C;
|
||||
C c;
|
||||
c.insert(std::make_pair(1, "one"));
|
||||
C::iterator i = c.begin();
|
||||
++i;
|
||||
assert(i == c.end());
|
||||
++i;
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -15,35 +15,20 @@
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_multimap<int, std::string> C;
|
||||
C c;
|
||||
c.insert(std::make_pair(1, "one"));
|
||||
C::iterator i = c.end();
|
||||
C::value_type j = *i;
|
||||
assert(false);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
|
||||
min_allocator<std::pair<const int, std::string>>> C;
|
||||
C c;
|
||||
c.insert(std::make_pair(1, "one"));
|
||||
C::iterator i = c.end();
|
||||
C::value_type j = *i;
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_map>
|
||||
|
||||
// Increment iterator past end.
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <cassert>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
|
||||
min_allocator<std::pair<const int, std::string>>> C;
|
||||
C c;
|
||||
c.insert(std::make_pair(1, "one"));
|
||||
C::iterator i = c.begin();
|
||||
++i;
|
||||
assert(i == c.end());
|
||||
++i;
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_map>
|
||||
|
||||
// Dereference non-dereferenceable iterator.
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_map>
|
||||
#include <cassert>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
|
||||
min_allocator<std::pair<const int, std::string>>> C;
|
||||
C c(1);
|
||||
C::local_iterator i = c.end(0);
|
||||
C::value_type j = *i;
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -16,35 +16,18 @@
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_multimap<int, std::string> C;
|
||||
C c(1);
|
||||
C::local_iterator i = c.begin(0);
|
||||
++i;
|
||||
++i;
|
||||
assert(false);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
|
||||
min_allocator<std::pair<const int, std::string>>> C;
|
||||
C c(1);
|
||||
C::local_iterator i = c.begin(0);
|
||||
++i;
|
||||
++i;
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -16,32 +16,17 @@
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_multimap<int, std::string> C;
|
||||
C c(1);
|
||||
C::local_iterator i = c.end(0);
|
||||
C::value_type j = *i;
|
||||
assert(false);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
|
||||
min_allocator<std::pair<const int, std::string>>> C;
|
||||
C c(1);
|
||||
C::local_iterator i = c.end(0);
|
||||
C::value_type j = *i;
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_map>
|
||||
|
||||
// Increment local_iterator past end.
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_map>
|
||||
#include <cassert>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
|
||||
min_allocator<std::pair<const int, std::string>>> C;
|
||||
C c(1);
|
||||
C::local_iterator i = c.begin(0);
|
||||
++i;
|
||||
++i;
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -23,17 +23,14 @@
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
std::unordered_multimap<int, int> s1 = {{1, 1}, {2, 2}, {3, 3}};
|
||||
std::unordered_multimap<int, int>::iterator i = s1.begin();
|
||||
std::pair<const int, int> k = *i;
|
||||
std::unordered_multimap<int, int> s2 = std::move(s1);
|
||||
assert(*i == k);
|
||||
s2.erase(i);
|
||||
assert(s2.size() == 2);
|
||||
}
|
||||
int main(int, char**) {
|
||||
std::unordered_multimap<int, int> s1 = {{1, 1}, {2, 2}, {3, 3}};
|
||||
std::unordered_multimap<int, int>::iterator i = s1.begin();
|
||||
std::pair<const int, int> k = *i;
|
||||
std::unordered_multimap<int, int> s2 = std::move(s1);
|
||||
assert(*i == k);
|
||||
s2.erase(i);
|
||||
assert(s2.size() == 2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -21,26 +21,25 @@
|
||||
|
||||
#include <unordered_map>
|
||||
#include <cassert>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
typedef std::pair<int, int> P;
|
||||
P a1[] = {P(1, 1), P(3, 3), P(7, 7), P(9, 9), P(10, 10)};
|
||||
P a2[] = {P(0, 0), P(2, 2), P(4, 4), P(5, 5), P(6, 6), P(8, 8), P(11, 11)};
|
||||
std::unordered_multimap<int, int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
|
||||
std::unordered_multimap<int, int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
|
||||
std::unordered_multimap<int, int>::iterator i1 = c1.begin();
|
||||
std::unordered_multimap<int, int>::iterator i2 = c2.begin();
|
||||
swap(c1, c2);
|
||||
c1.erase(i2);
|
||||
c2.erase(i1);
|
||||
std::unordered_multimap<int, int>::iterator j = i1;
|
||||
c1.erase(i1);
|
||||
assert(false);
|
||||
}
|
||||
typedef std::pair<int, int> P;
|
||||
P a1[] = {P(1, 1), P(3, 3), P(7, 7), P(9, 9), P(10, 10)};
|
||||
P a2[] = {P(0, 0), P(2, 2), P(4, 4), P(5, 5), P(6, 6), P(8, 8), P(11, 11)};
|
||||
std::unordered_multimap<int, int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
|
||||
std::unordered_multimap<int, int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
|
||||
std::unordered_multimap<int, int>::iterator i1 = c1.begin();
|
||||
std::unordered_multimap<int, int>::iterator i2 = c2.begin();
|
||||
swap(c1, c2);
|
||||
c1.erase(i2);
|
||||
c2.erase(i1);
|
||||
std::unordered_multimap<int, int>::iterator j = i1;
|
||||
c1.erase(i1);
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_map>
|
||||
|
||||
// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
|
||||
// class Alloc = allocator<pair<const Key, T>>>
|
||||
// class unordered_multimap
|
||||
|
||||
// float max_load_factor() const;
|
||||
// void max_load_factor(float mlf);
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_multimap<int, std::string> C;
|
||||
C c;
|
||||
c.max_load_factor(0);
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -17,17 +17,17 @@
|
||||
|
||||
#include <unordered_map>
|
||||
#include <cassert>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef std::pair<int, int> P;
|
||||
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
|
||||
std::unordered_multimap<int, int> l1(a1, a1+3);
|
||||
std::unordered_multimap<int, int>::const_iterator i = l1.end();
|
||||
l1.erase(i);
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,14 +17,11 @@
|
||||
|
||||
#include <unordered_map>
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
#include <exception>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef std::pair<int, int> P;
|
||||
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
|
||||
std::unordered_multimap<int, int> l1(a1, a1+3);
|
||||
@@ -32,5 +29,6 @@ int main(int, char**)
|
||||
std::unordered_multimap<int, int>::const_iterator i = l2.begin();
|
||||
l1.erase(i);
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,19 +17,17 @@
|
||||
|
||||
#include <unordered_map>
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef std::pair<int, int> P;
|
||||
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
|
||||
std::unordered_multimap<int, int> l1(a1, a1+3);
|
||||
std::unordered_multimap<int, int> l2(a1, a1+3);
|
||||
std::unordered_multimap<int, int>::iterator i = l1.erase(l2.cbegin(), next(l1.cbegin()));
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,19 +17,17 @@
|
||||
|
||||
#include <unordered_map>
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef std::pair<int, int> P;
|
||||
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
|
||||
std::unordered_multimap<int, int> l1(a1, a1+3);
|
||||
std::unordered_multimap<int, int> l2(a1, a1+3);
|
||||
std::unordered_multimap<int, int>::iterator i = l1.erase(l1.cbegin(), next(l2.cbegin()));
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,19 +17,17 @@
|
||||
|
||||
#include <unordered_map>
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef std::pair<int, int> P;
|
||||
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
|
||||
std::unordered_multimap<int, int> l1(a1, a1+3);
|
||||
std::unordered_multimap<int, int> l2(a1, a1+3);
|
||||
std::unordered_multimap<int, int>::iterator i = l1.erase(l2.cbegin(), next(l2.cbegin()));
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,18 +17,16 @@
|
||||
|
||||
#include <unordered_map>
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef std::pair<int, int> P;
|
||||
P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
|
||||
std::unordered_multimap<int, int> l1(a1, a1+3);
|
||||
std::unordered_multimap<int, int>::iterator i = l1.erase(next(l1.cbegin()), l1.cbegin());
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_set>
|
||||
|
||||
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
|
||||
// class Alloc = allocator<Value>>
|
||||
// class unordered_multiset
|
||||
|
||||
// size_type bucket(const key_type& __k) const;
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_multiset<int> C;
|
||||
C c;
|
||||
(void) c.bucket(3);
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_set>
|
||||
|
||||
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
|
||||
// class Alloc = allocator<Value>>
|
||||
// class unordered_multiset
|
||||
|
||||
// size_type bucket_size(size_type n) const
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_multiset<int> C;
|
||||
C c;
|
||||
(void) c.bucket_size(3);
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -20,19 +20,16 @@
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
typedef std::unordered_multiset<double> C;
|
||||
typedef C::iterator R;
|
||||
typedef C::value_type P;
|
||||
C c;
|
||||
C c2;
|
||||
C::const_iterator e = c2.end();
|
||||
P v(3.5);
|
||||
R r = c.insert(e, v);
|
||||
assert(false);
|
||||
}
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_multiset<double> C;
|
||||
typedef C::iterator R;
|
||||
typedef C::value_type P;
|
||||
C c;
|
||||
C c2;
|
||||
C::const_iterator e = c2.end();
|
||||
P v(3.5);
|
||||
R r = c.insert(e, v);
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_set>
|
||||
|
||||
// Dereference non-dereferenceable iterator.
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <functional>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef int T;
|
||||
typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
|
||||
C c(1);
|
||||
C::iterator i = c.end();
|
||||
(void) *i;
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -17,16 +17,10 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef int T;
|
||||
typedef std::unordered_multiset<T> C;
|
||||
C c(1);
|
||||
@@ -35,17 +29,6 @@ int main(int, char**)
|
||||
assert(i == c.end());
|
||||
++i;
|
||||
assert(false);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef int T;
|
||||
typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
|
||||
C c(1);
|
||||
C::iterator i = c.begin();
|
||||
++i;
|
||||
assert(i == c.end());
|
||||
++i;
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,31 +17,16 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef int T;
|
||||
typedef std::unordered_multiset<T> C;
|
||||
C c(1);
|
||||
C::iterator i = c.end();
|
||||
(void) *i;
|
||||
assert(false);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef int T;
|
||||
typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
|
||||
C c(1);
|
||||
C::iterator i = c.end();
|
||||
(void) *i;
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_set>
|
||||
|
||||
// Increment iterator past end.
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <functional>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef int T;
|
||||
typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
|
||||
C c(1);
|
||||
C::iterator i = c.begin();
|
||||
++i;
|
||||
assert(i == c.end());
|
||||
++i;
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_set>
|
||||
|
||||
// Dereference non-dereferenceable iterator.
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <functional>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef int T;
|
||||
typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
|
||||
C c(1);
|
||||
C::local_iterator i = c.end(0);
|
||||
(void) *i;
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -17,16 +17,10 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef int T;
|
||||
typedef std::unordered_multiset<T> C;
|
||||
C c(1);
|
||||
@@ -34,17 +28,6 @@ int main(int, char**)
|
||||
++i;
|
||||
++i;
|
||||
assert(false);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef int T;
|
||||
typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
|
||||
C c(1);
|
||||
C::local_iterator i = c.begin(0);
|
||||
++i;
|
||||
++i;
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,31 +17,16 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef int T;
|
||||
typedef std::unordered_multiset<T> C;
|
||||
C c(1);
|
||||
C::local_iterator i = c.end(0);
|
||||
(void) *i;
|
||||
assert(false);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef int T;
|
||||
typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
|
||||
C c(1);
|
||||
C::local_iterator i = c.end(0);
|
||||
(void) *i;
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_set>
|
||||
|
||||
// Increment local_iterator past end.
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <functional>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef int T;
|
||||
typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
|
||||
C c(1);
|
||||
C::local_iterator i = c.begin(0);
|
||||
++i;
|
||||
++i;
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -23,17 +23,14 @@
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
std::unordered_multiset<int> s1 = {1, 2, 3};
|
||||
std::unordered_multiset<int>::iterator i = s1.begin();
|
||||
int k = *i;
|
||||
std::unordered_multiset<int> s2 = std::move(s1);
|
||||
assert(*i == k);
|
||||
s2.erase(i);
|
||||
assert(s2.size() == 2);
|
||||
}
|
||||
int main(int, char**) {
|
||||
std::unordered_multiset<int> s1 = {1, 2, 3};
|
||||
std::unordered_multiset<int>::iterator i = s1.begin();
|
||||
int k = *i;
|
||||
std::unordered_multiset<int> s2 = std::move(s1);
|
||||
assert(*i == k);
|
||||
s2.erase(i);
|
||||
assert(s2.size() == 2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -24,22 +24,19 @@
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int a1[] = {1, 3, 7, 9, 10};
|
||||
int a2[] = {0, 2, 4, 5, 6, 8, 11};
|
||||
std::unordered_multiset<int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
|
||||
std::unordered_multiset<int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
|
||||
std::unordered_multiset<int>::iterator i1 = c1.begin();
|
||||
std::unordered_multiset<int>::iterator i2 = c2.begin();
|
||||
swap(c1, c2);
|
||||
c1.erase(i2);
|
||||
c2.erase(i1);
|
||||
std::unordered_multiset<int>::iterator j = i1;
|
||||
c1.erase(i1);
|
||||
assert(false);
|
||||
}
|
||||
int main(int, char**) {
|
||||
int a1[] = {1, 3, 7, 9, 10};
|
||||
int a2[] = {0, 2, 4, 5, 6, 8, 11};
|
||||
std::unordered_multiset<int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
|
||||
std::unordered_multiset<int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
|
||||
std::unordered_multiset<int>::iterator i1 = c1.begin();
|
||||
std::unordered_multiset<int>::iterator i2 = c2.begin();
|
||||
swap(c1, c2);
|
||||
c1.erase(i2);
|
||||
c2.erase(i1);
|
||||
std::unordered_multiset<int>::iterator j = i1;
|
||||
c1.erase(i1);
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -20,13 +20,12 @@
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
int a1[] = {1, 2, 3};
|
||||
std::unordered_multiset<int> l1(a1, a1+3);
|
||||
std::unordered_multiset<int>::const_iterator i = l1.end();
|
||||
l1.erase(i);
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,19 +17,16 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
#include <exception>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
int a1[] = {1, 2, 3};
|
||||
std::unordered_multiset<int> l1(a1, a1+3);
|
||||
std::unordered_multiset<int> l2(a1, a1+3);
|
||||
std::unordered_multiset<int>::const_iterator i = l2.begin();
|
||||
l1.erase(i);
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,18 +17,15 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
int a1[] = {1, 2, 3};
|
||||
std::unordered_multiset<int> l1(a1, a1+3);
|
||||
std::unordered_multiset<int> l2(a1, a1+3);
|
||||
std::unordered_multiset<int>::iterator i = l1.erase(l2.cbegin(), next(l1.cbegin()));
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,18 +17,15 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
int a1[] = {1, 2, 3};
|
||||
std::unordered_multiset<int> l1(a1, a1+3);
|
||||
std::unordered_multiset<int> l2(a1, a1+3);
|
||||
std::unordered_multiset<int>::iterator i = l1.erase(l1.cbegin(), next(l2.cbegin()));
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,18 +17,15 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
int a1[] = {1, 2, 3};
|
||||
std::unordered_multiset<int> l1(a1, a1+3);
|
||||
std::unordered_multiset<int> l2(a1, a1+3);
|
||||
std::unordered_multiset<int>::iterator i = l1.erase(l2.cbegin(), next(l2.cbegin()));
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,17 +17,14 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
int a1[] = {1, 2, 3};
|
||||
std::unordered_multiset<int> l1(a1, a1+3);
|
||||
std::unordered_multiset<int>::iterator i = l1.erase(next(l1.cbegin()), l1.cbegin());
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_set>
|
||||
|
||||
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
|
||||
// class Alloc = allocator<Value>>
|
||||
// class unordered_multiset
|
||||
|
||||
// float max_load_factor() const;
|
||||
// void max_load_factor(float mlf);
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_multiset<int> C;
|
||||
C c;
|
||||
c.max_load_factor(0);
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_set>
|
||||
|
||||
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
|
||||
// class Alloc = allocator<Value>>
|
||||
// class unordered_set
|
||||
|
||||
// size_type bucket(const key_type& __k) const;
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_set<int> C;
|
||||
C c;
|
||||
(void) c.bucket(3);
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_set>
|
||||
|
||||
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
|
||||
// class Alloc = allocator<Value>>
|
||||
// class unordered_set
|
||||
|
||||
// size_type bucket_size(size_type n) const
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_set<int> C;
|
||||
C c;
|
||||
(void) c.bucket_size(3);
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -20,19 +20,16 @@
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
typedef std::unordered_set<double> C;
|
||||
typedef C::iterator R;
|
||||
typedef C::value_type P;
|
||||
C c;
|
||||
C c2;
|
||||
C::const_iterator e = c2.end();
|
||||
P v(3.5);
|
||||
R r = c.insert(e, v);
|
||||
assert(false);
|
||||
}
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_set<double> C;
|
||||
typedef C::iterator R;
|
||||
typedef C::value_type P;
|
||||
C c;
|
||||
C c2;
|
||||
C::const_iterator e = c2.end();
|
||||
P v(3.5);
|
||||
R r = c.insert(e, v);
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_set>
|
||||
|
||||
// Dereference non-dereferenceable iterator.
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <functional>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef int T;
|
||||
typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
|
||||
C c(1);
|
||||
C::iterator i = c.end();
|
||||
(void) *i;
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -17,16 +17,10 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef int T;
|
||||
typedef std::unordered_set<T> C;
|
||||
C c(1);
|
||||
@@ -35,17 +29,6 @@ int main(int, char**)
|
||||
assert(i == c.end());
|
||||
++i;
|
||||
assert(false);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef int T;
|
||||
typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
|
||||
C c(1);
|
||||
C::iterator i = c.begin();
|
||||
++i;
|
||||
assert(i == c.end());
|
||||
++i;
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,31 +17,16 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef int T;
|
||||
typedef std::unordered_set<T> C;
|
||||
C c(1);
|
||||
C::iterator i = c.end();
|
||||
(void) *i;
|
||||
assert(false);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef int T;
|
||||
typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
|
||||
C c(1);
|
||||
C::iterator i = c.end();
|
||||
(void) *i;
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_set>
|
||||
|
||||
// Increment iterator past end.
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <functional>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef int T;
|
||||
typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
|
||||
C c(1);
|
||||
C::iterator i = c.begin();
|
||||
++i;
|
||||
assert(i == c.end());
|
||||
++i;
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_set>
|
||||
|
||||
// Dereference non-dereferenceable iterator.
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <functional>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef int T;
|
||||
typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
|
||||
C c(1);
|
||||
C::local_iterator i = c.end(0);
|
||||
(void) *i;
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -17,16 +17,10 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef int T;
|
||||
typedef std::unordered_set<T> C;
|
||||
C c(1);
|
||||
@@ -34,17 +28,6 @@ int main(int, char**)
|
||||
++i;
|
||||
++i;
|
||||
assert(false);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef int T;
|
||||
typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
|
||||
C c(1);
|
||||
C::local_iterator i = c.begin(0);
|
||||
++i;
|
||||
++i;
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,32 +17,16 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
typedef int T;
|
||||
typedef std::unordered_set<T> C;
|
||||
C c(1);
|
||||
C::local_iterator i = c.end(0);
|
||||
(void) *i;
|
||||
assert(false);
|
||||
|
||||
assert(false);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef int T;
|
||||
typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
|
||||
C c(1);
|
||||
C::local_iterator i = c.end(0);
|
||||
(void) *i;
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_set>
|
||||
|
||||
// Increment local_iterator past end.
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <functional>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef int T;
|
||||
typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
|
||||
C c(1);
|
||||
C::local_iterator i = c.begin(0);
|
||||
++i;
|
||||
++i;
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -22,17 +22,14 @@
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
std::unordered_set<int> s1 = {1, 2, 3};
|
||||
std::unordered_set<int>::iterator i = s1.begin();
|
||||
int k = *i;
|
||||
std::unordered_set<int> s2 = std::move(s1);
|
||||
assert(*i == k);
|
||||
s2.erase(i);
|
||||
assert(s2.size() == 2);
|
||||
}
|
||||
int main(int, char**) {
|
||||
std::unordered_set<int> s1 = {1, 2, 3};
|
||||
std::unordered_set<int>::iterator i = s1.begin();
|
||||
int k = *i;
|
||||
std::unordered_set<int> s2 = std::move(s1);
|
||||
assert(*i == k);
|
||||
s2.erase(i);
|
||||
assert(s2.size() == 2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -24,22 +24,19 @@
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int a1[] = {1, 3, 7, 9, 10};
|
||||
int a2[] = {0, 2, 4, 5, 6, 8, 11};
|
||||
std::unordered_set<int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
|
||||
std::unordered_set<int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
|
||||
std::unordered_set<int>::iterator i1 = c1.begin();
|
||||
std::unordered_set<int>::iterator i2 = c2.begin();
|
||||
swap(c1, c2);
|
||||
c1.erase(i2);
|
||||
c2.erase(i1);
|
||||
std::unordered_set<int>::iterator j = i1;
|
||||
c1.erase(i1);
|
||||
assert(false);
|
||||
}
|
||||
int main(int, char**) {
|
||||
int a1[] = {1, 3, 7, 9, 10};
|
||||
int a2[] = {0, 2, 4, 5, 6, 8, 11};
|
||||
std::unordered_set<int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
|
||||
std::unordered_set<int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
|
||||
std::unordered_set<int>::iterator i1 = c1.begin();
|
||||
std::unordered_set<int>::iterator i2 = c2.begin();
|
||||
swap(c1, c2);
|
||||
c1.erase(i2);
|
||||
c2.erase(i1);
|
||||
std::unordered_set<int>::iterator j = i1;
|
||||
c1.erase(i1);
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -20,13 +20,12 @@
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
int a1[] = {1, 2, 3};
|
||||
std::unordered_set<int> l1(a1, a1+3);
|
||||
std::unordered_set<int>::const_iterator i = l1.end();
|
||||
l1.erase(i);
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -18,18 +18,16 @@
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
#include <exception>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
int a1[] = {1, 2, 3};
|
||||
std::unordered_set<int> l1(a1, a1+3);
|
||||
std::unordered_set<int> l2(a1, a1+3);
|
||||
std::unordered_set<int>::const_iterator i = l2.begin();
|
||||
l1.erase(i);
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,18 +17,15 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
int a1[] = {1, 2, 3};
|
||||
std::unordered_set<int> l1(a1, a1+3);
|
||||
std::unordered_set<int> l2(a1, a1+3);
|
||||
std::unordered_set<int>::iterator i = l1.erase(l2.cbegin(), next(l1.cbegin()));
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,18 +17,15 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
int a1[] = {1, 2, 3};
|
||||
std::unordered_set<int> l1(a1, a1+3);
|
||||
std::unordered_set<int> l2(a1, a1+3);
|
||||
std::unordered_set<int>::iterator i = l1.erase(l1.cbegin(), next(l2.cbegin()));
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,18 +17,15 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
int a1[] = {1, 2, 3};
|
||||
std::unordered_set<int> l1(a1, a1+3);
|
||||
std::unordered_set<int> l2(a1, a1+3);
|
||||
std::unordered_set<int>::iterator i = l1.erase(l2.cbegin(), next(l2.cbegin()));
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,17 +17,14 @@
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
{
|
||||
int main(int, char**) {
|
||||
int a1[] = {1, 2, 3};
|
||||
std::unordered_set<int> l1(a1, a1+3);
|
||||
std::unordered_set<int>::iterator i = l1.erase(next(l1.cbegin()), l1.cbegin());
|
||||
assert(false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <unordered_set>
|
||||
|
||||
// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
|
||||
// class Alloc = allocator<Value>>
|
||||
// class unordered_set
|
||||
|
||||
// float max_load_factor() const;
|
||||
// void max_load_factor(float mlf);
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**) {
|
||||
typedef std::unordered_set<int> C;
|
||||
C c;
|
||||
c.max_load_factor(-0.5f);
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <string>
|
||||
|
||||
// const charT& back() const;
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**) {
|
||||
std::string const s;
|
||||
(void) s.back();
|
||||
assert(false);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <string>
|
||||
|
||||
// charT& back();
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**) {
|
||||
std::string s;
|
||||
(void) s.back();
|
||||
assert(false);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <string>
|
||||
|
||||
// const charT& front() const;
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**) {
|
||||
std::string const s;
|
||||
(void) s.front();
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <string>
|
||||
|
||||
// charT& front();
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**) {
|
||||
std::string s;
|
||||
(void) s.front();
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <string>
|
||||
|
||||
// const_reference operator[](size_type pos) const;
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**) {
|
||||
std::string const s;
|
||||
char c = s[0];
|
||||
assert(c == '\0');
|
||||
c = s[1];
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <string>
|
||||
|
||||
// reference operator[](size_type pos);
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**) {
|
||||
std::string s;
|
||||
char c = s[0];
|
||||
assert(c == '\0');
|
||||
c = s[1];
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03, c++11, c++14
|
||||
// <optional>
|
||||
|
||||
// constexpr T& optional<T>::operator*() &;
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <optional>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**) {
|
||||
std::optional<int> opt;
|
||||
int x = *opt; (void)x;
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03, c++11, c++14
|
||||
// <optional>
|
||||
|
||||
// constexpr const T& optional<T>::operator*() const &;
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <optional>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**) {
|
||||
const std::optional<int> opt;
|
||||
int x = *opt; (void)x;
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03, c++11, c++14
|
||||
// <optional>
|
||||
|
||||
// constexpr T&& optional<T>::operator*() const &&;
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <optional>
|
||||
#include <cassert>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**) {
|
||||
std::optional<int> opt;
|
||||
int x = *std::move(opt); (void)x;
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03, c++11, c++14
|
||||
// <optional>
|
||||
|
||||
// constexpr T&& optional<T>::operator*() &&;
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <optional>
|
||||
#include <cassert>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
||||
int main(int, char**) {
|
||||
std::optional<int> opt;
|
||||
int x = *std::move(opt); (void)x;
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03, c++11, c++14
|
||||
// <optional>
|
||||
|
||||
// constexpr T* optional<T>::operator->();
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <optional>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
struct X {
|
||||
int test() noexcept {return 3;}
|
||||
};
|
||||
|
||||
int main(int, char**) {
|
||||
std::optional<X> opt;
|
||||
assert(opt->test() == 3);
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03, c++11, c++14
|
||||
// <optional>
|
||||
|
||||
// constexpr const T* optional<T>::operator->() const;
|
||||
|
||||
// UNSUPPORTED: libcxx-no-debug-mode
|
||||
|
||||
#define _LIBCPP_DEBUG 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <optional>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
struct X {
|
||||
constexpr int test() const {return 3;}
|
||||
};
|
||||
|
||||
int main(int, char**) {
|
||||
const std::optional<X> opt;
|
||||
assert(opt->test() == 3);
|
||||
assert(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -14,10 +14,6 @@
|
||||
|
||||
// size_type bucket_size(size_type n) const
|
||||
|
||||
#ifdef _LIBCPP_DEBUG
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
#endif
|
||||
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
@@ -70,14 +66,6 @@ int main(int, char**)
|
||||
LIBCPP_ASSERT(c.bucket_size(4) == 1);
|
||||
}
|
||||
#endif
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 1
|
||||
{
|
||||
typedef std::unordered_map<int, std::string> C;
|
||||
C c;
|
||||
(void) c.bucket_size(3);
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -15,11 +15,6 @@
|
||||
// float max_load_factor() const;
|
||||
// void max_load_factor(float mlf);
|
||||
|
||||
|
||||
#ifdef _LIBCPP_DEBUG
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
#endif
|
||||
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
@@ -57,14 +52,6 @@ int main(int, char**)
|
||||
assert(c.max_load_factor() == 2.5);
|
||||
}
|
||||
#endif
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 1
|
||||
{
|
||||
typedef std::unordered_map<int, std::string> C;
|
||||
C c;
|
||||
c.max_load_factor(0);
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -14,10 +14,6 @@
|
||||
|
||||
// size_type bucket(const key_type& __k) const;
|
||||
|
||||
#ifdef _LIBCPP_DEBUG
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
#endif
|
||||
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
@@ -66,14 +62,6 @@ int main(int, char**)
|
||||
LIBCPP_ASSERT(c.bucket(i) == i % bc);
|
||||
}
|
||||
#endif
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 1
|
||||
{
|
||||
typedef std::unordered_multimap<int, std::string> C;
|
||||
C c;
|
||||
(void) c.bucket(3);
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -14,10 +14,6 @@
|
||||
|
||||
// size_type bucket_size(size_type n) const
|
||||
|
||||
#ifdef _LIBCPP_DEBUG
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
#endif
|
||||
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
@@ -74,14 +70,6 @@ int main(int, char**)
|
||||
LIBCPP_ASSERT(c.bucket_size(6) == 0);
|
||||
}
|
||||
#endif
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 1
|
||||
{
|
||||
typedef std::unordered_multimap<int, std::string> C;
|
||||
C c;
|
||||
(void) c.bucket_size(3);
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -15,10 +15,6 @@
|
||||
// float max_load_factor() const;
|
||||
// void max_load_factor(float mlf);
|
||||
|
||||
#ifdef _LIBCPP_DEBUG
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
#endif
|
||||
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
@@ -56,14 +52,6 @@ int main(int, char**)
|
||||
assert(c.max_load_factor() == 2.5);
|
||||
}
|
||||
#endif
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 1
|
||||
{
|
||||
typedef std::unordered_multimap<int, std::string> C;
|
||||
C c;
|
||||
c.max_load_factor(0);
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -14,10 +14,6 @@
|
||||
|
||||
// size_type bucket(const key_type& __k) const;
|
||||
|
||||
#ifdef _LIBCPP_DEBUG
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
#endif
|
||||
|
||||
#include <unordered_set>
|
||||
#include <cassert>
|
||||
|
||||
@@ -65,14 +61,6 @@ int main(int, char**)
|
||||
LIBCPP_ASSERT(c.bucket(i) == i % bc);
|
||||
}
|
||||
#endif
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 1
|
||||
{
|
||||
typedef std::unordered_multiset<int> C;
|
||||
C c;
|
||||
(void) c.bucket(3);
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user