1 // If you modify this, please update simple11.cc and debug.cc as well.
4 // { dg-options "-g -O0 -std=gnu++98" }
5 // { dg-skip-if "" { *-*-* } { "-D_GLIBCXX_PROFILE" } }
7 // Copyright (C) 2011-2017 Free Software Foundation, Inc.
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)
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.
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/>.
24 // Type printers only recognize the old std::string for now.
25 #define _GLIBCXX_USE_CXX11_ABI 0
41 std::string str
= "zardoz";
42 // { dg-final { note-test str "\"zardoz\"" } }
48 // { dg-final { note-test bs {std::bitset = {[0] = 1, [5] = 1, [7] = 1}} } }
50 std::deque
<std::string
> deq
;
53 // { dg-final { note-test deq {std::deque with 2 elements = {"one", "two"}} } }
55 std::deque
<int>::iterator deqiter0
;
56 // { dg-final { note-test deqiter0 {non-dereferenceable iterator for std::deque} } }
58 std::deque
<std::string
>::iterator deqiter
= deq
.begin();
59 // { dg-final { note-test deqiter {"one"} } }
61 std::list
<std::string
> lst
;
64 // { dg-final { note-test lst {std::list = {[0] = "one", [1] = "two"}} } }
66 std::list
<int>::iterator lstiter0
;
67 // { dg-final { note-test lstiter0 {non-dereferenceable iterator for std::list} } }
69 std::list
<std::string
>::iterator lstiter
= lst
.begin();
71 // { dg-final { note-test lstiter {"one"}} }
73 std::list
<std::string
>::const_iterator lstciter
= lst
.begin();
75 // { dg-final { note-test lstciter {"one"}} }
77 std::map
<std::string
, int> mp
;
79 // { dg-final { note-test mp {std::map with 1 element = {["zardoz"] = 23}} } }
81 std::map
<std::string
, int>::iterator mpiter
= mp
.begin();
82 // { dg-final { note-test mpiter {{first = "zardoz", second = 23}} } }
84 std::map
<std::string
, int>::iterator mpiter0
;
85 // { dg-final { note-test mpiter0 {non-dereferenceable iterator for associative container} } }
91 const std::set
<int> const_intset
= intset
;
92 // { dg-final { note-test const_intset {std::set with 2 elements = {[0] = 2, [1] = 3}} } }
94 std::set
<std::string
> sp
;
95 sp
.insert("clownfish");
97 // { dg-final { note-test sp {std::set with 2 elements = {[0] = "barrel", [1] = "clownfish"}} } }
99 std::set
<std::string
>::const_iterator spciter
= sp
.begin();
100 // { dg-final { note-test spciter {"barrel"} } }
102 std::set
<int>::iterator spiter0
;
103 // { dg-final { note-test spiter0 {non-dereferenceable iterator for associative container} } }
109 // { dg-final { note-test v {std::vector of length 1, capacity 2 = {2}} } }
110 std::vector
<int>::iterator viter3
= v
.begin();
111 // { dg-final { note-test viter3 {2} } }
113 std::vector
<int>::iterator viter0
;
114 // { dg-final { note-test viter0 {non-dereferenceable iterator for std::vector} } }
116 __gnu_cxx::slist
<int> sll
;
119 // { dg-final { note-test sll {__gnu_cxx::slist = {[0] = 47, [1] = 23}} } }
121 __gnu_cxx::slist
<int>::iterator slliter
= sll
.begin();
122 // { dg-final { note-test slliter {47} } }
124 __gnu_cxx::slist
<int>::iterator slliter0
;
125 // { dg-final { note-test slliter0 {non-dereferenceable iterator for __gnu_cxx::slist} } }
128 return 0; // Mark SPOT
131 // { dg-final { gdb-test SPOT } }