OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libstdc++-v3/] [testsuite/] [ext/] [profile/] [all.cc] - Blame information for rev 742

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.