1292236Sjhb// Copyright (C) 2005-2015 Free Software Foundation, Inc.
2292236Sjhb//
3292236Sjhb// This file is part of the GNU ISO C++ Library.  This library is free
4292236Sjhb// software; you can redistribute it and/or modify it under the
5292236Sjhb// terms of the GNU General Public License as published by the
6292236Sjhb// Free Software Foundation; either version 3, or (at your option)
7292236Sjhb// any later version.
8292236Sjhb
9292236Sjhb// This library is distributed in the hope that it will be useful,
10292236Sjhb// but WITHOUT ANY WARRANTY; without even the implied warranty of
11292236Sjhb// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12292236Sjhb// GNU General Public License for more details.
13292236Sjhb
14292236Sjhb// You should have received a copy of the GNU General Public License along
15292236Sjhb// with this library; see the file COPYING3.  If not see
16292236Sjhb// <http://www.gnu.org/licenses/>.
17292236Sjhb
18292236Sjhb// 25.3.3.1 [lib.lower.bound]
19292236Sjhb
20292236Sjhb#include <algorithm>
21292236Sjhb#include <testsuite_hooks.h>
22292236Sjhb#include <testsuite_iterators.h>
23292236Sjhb
24292236Sjhbusing __gnu_test::test_container;
25292236Sjhbusing __gnu_test::forward_iterator_wrapper;
26292236Sjhbusing std::lower_bound;
27332244Stuexen
28292236Sjhbtypedef test_container<int, forward_iterator_wrapper> Container;
29292236Sjhbint array[] = {0, 0, 0, 0, 1, 1, 1, 1};
30292236Sjhb
31292236Sjhbvoid
32292236Sjhbtest1()
33292236Sjhb{
34292236Sjhb  for(int i = 0; i < 5; ++i)
35311999Sjhb    for(int j = 4; j < 7; ++j)
36311999Sjhb      {
37311999Sjhb	Container con(array + i, array + j);
38311999Sjhb	VERIFY(lower_bound(con.begin(), con.end(), 1).ptr == array + 4);
39292236Sjhb      }
40292236Sjhb}
41292236Sjhb
42292236Sjhbint
43292236Sjhbmain()
44294849Sjhb{
45294849Sjhb  test1();
46294849Sjhb}
47294849Sjhb