<commit_before>//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <vector>

// void shrink_to_fit();

#include <vector>
#include <cassert>
#include "../../../stack_allocator.h"

int main()
{
    {
        std::vector<int> v(100);
        v.push_back(1);
        v.shrink_to_fit();
        assert(v.capacity() == 101);
        assert(v.size() == 101);
    }
    {
        std::vector<int, stack_allocator<int, 401> > v(100);
        v.push_back(1);
        v.shrink_to_fit();
        assert(v.capacity() == 101);
        assert(v.size() == 101);
    }
    {
        std::vector<int, stack_allocator<int, 400> > v(100);
        v.push_back(1);
        v.shrink_to_fit();
        assert(v.capacity() == 200);
        assert(v.size() == 101);
    }
}<commit_msg>The 3rd test in shrink_to_fit.pass.cpp can't possibly pass if exceptions are disabled, so #ifdef'ing out the test.<commit_after>//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <vector>

// void shrink_to_fit();

#include <vector>
#include <cassert>
#include "../../../stack_allocator.h"

int main()
{
    {
        std::vector<int> v(100);
        v.push_back(1);
        v.shrink_to_fit();
        assert(v.capacity() == 101);
        assert(v.size() == 101);
    }
    {
        std::vector<int, stack_allocator<int, 401> > v(100);
        v.push_back(1);
        v.shrink_to_fit();
        assert(v.capacity() == 101);
        assert(v.size() == 101);
    }
#ifndef _LIBCPP_NO_EXCEPTIONS
    {
        std::vector<int, stack_allocator<int, 400> > v(100);
        v.push_back(1);
        v.shrink_to_fit();
        assert(v.capacity() == 200);
        assert(v.size() == 101);
    }
#endif
}
{'fraction_non_alphanumeric': 0.2830105633802817, 'fraction_numerical': 0.032130281690140844, 'mean_word_length': 1.4895947426067908, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7251337', 'n_tokens_mistral': 758, 'n_tokens_neox': 682, 'n_words': 147}