Howard Hinnant | c52f43e | 2010-08-22 00:59:46 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Howard Hinnant | b64f8b0 | 2010-11-16 22:09:02 +0000 | [diff] [blame] | 5 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 6 | // Source Licenses. See LICENSE.TXT for details. |
Howard Hinnant | c52f43e | 2010-08-22 00:59:46 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | // <memory> |
| 11 | |
| 12 | // allocator: |
| 13 | // size_type max_size() const throw(); |
| 14 | |
| 15 | #include <memory> |
| 16 | #include <limits> |
| 17 | #include <cstddef> |
| 18 | #include <cassert> |
| 19 | |
| 20 | int new_called = 0; |
| 21 | |
| 22 | int main() |
| 23 | { |
| 24 | const std::allocator<int> a; |
Dan Albert | 1d4a1ed | 2016-05-25 22:36:09 -0700 | [diff] [blame^] | 25 | std::size_t M = a.max_size() * sizeof(int); |
| 26 | assert(M > 0xFFFF && M <= std::numeric_limits<std::size_t>::max()); |
Howard Hinnant | c52f43e | 2010-08-22 00:59:46 +0000 | [diff] [blame] | 27 | } |