]> git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/ext/profile/all.cc
all.cc: Pass -D_GLIBCXX_PROFILE_NO_THREADS for non-tls_native targets.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / ext / profile / all.cc
1 // { dg-options "-std=gnu++0x -O0 -D_GLIBCXX_PROFILE" }
2 // { dg-options "-std=gnu++0x -O0 -D_GLIBCXX_PROFILE -D_GLIBCXX_PROFILE_NO_THREADS" { target { ! tls_native } } }
3 // { dg-do compile }
4
5 // -*- C++ -*-
6
7 // Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
8 //
9 // This file is part of the GNU ISO C++ Library. This library is free
10 // software; you can redistribute it and/or modify it under the
11 // terms of the GNU General Public License as published by the
12 // Free Software Foundation; either version 3, or (at your option)
13 // any later version.
14 //
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License along
21 // with this library; see the file COPYING3. If not see
22 // <http://www.gnu.org/licenses/>.
23
24 #include <map>
25 #include <vector>
26 #include <unordered_map>
27
28 using std::map;
29 using std::vector;
30 using std::unordered_map;
31
32 struct dumb_hash {
33 size_t operator()(int x) const {return 0;}
34 size_t operator()(int x, int y) const {return x == y;}
35 };
36
37 int main() {
38 map<int, int> m_to_umap;
39 vector<int> v_to_list;
40 unordered_map<int, int> um_too_small;
41 unordered_map<int, int> um_too_large(1000000);
42 unordered_map<int, int, dumb_hash, dumb_hash> um_dumb_hash;
43
44 for (int i = 0; i < 10000; ++i) {
45 m_to_umap[i] = i;
46 v_to_list.insert(v_to_list.begin(), i);
47 um_too_small[i] = i;
48 um_too_small[i] = i;
49 um_dumb_hash[i] = i;
50 }
51 }