// { dg-do run { target c++11 } } // { dg-options "-g -O0" } // { dg-skip-if "" { *-*-* } { "-D_GLIBCXX_PROFILE" } } // Copyright (C) 2011-2018 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING3. If not see // . #include #include #include #include #include #include #include #include #include #include #include #include #include template void placeholder(const T *s) { std::cout << (void *) s; } template struct holder { T *f; }; // This test is written in a somewhat funny way. // Each type under test is used twice: first, to form a pointer type, // and second, as a template parameter. This is done to work around // apparent GCC oddities. The pointer type is needed to ensure that // the typedef in question ends up in the debuginfo; while the // template type is used to ensure that a typedef-less variant is // presented to gdb. int main() { std::string *string_ptr; holder string_holder; // { dg-final { whatis-test string_holder "holder" } } std::ios *ios_ptr; holder ios_holder; // { dg-final { whatis-test ios_holder "holder" } } std::streambuf *streambuf_ptr; holder streambuf_holder; // { dg-final { whatis-test streambuf_holder "holder" } } std::istream *istream_ptr; holder istream_holder; // { dg-final { whatis-test istream_holder "holder" } } std::ostream *ostream_ptr; holder ostream_holder; // { dg-final { whatis-test ostream_holder "holder" } } std::iostream *iostream_ptr; holder iostream_holder; // { dg-final { whatis-test iostream_holder "holder" } } std::stringbuf *stringbuf_ptr; holder stringbuf_holder; // { dg-final { whatis-test stringbuf_holder "holder" } } std::istringstream *istringstream_ptr; holder istringstream_holder; // { dg-final { whatis-test istringstream_holder "holder" } } std::ostringstream *ostringstream_ptr; holder ostringstream_holder; // { dg-final { whatis-test ostringstream_holder "holder" } } std::stringstream *stringstream_ptr; holder stringstream_holder; // { dg-final { whatis-test stringstream_holder "holder" } } std::filebuf *filebuf_ptr; holder filebuf_holder; // { dg-final { whatis-test filebuf_holder "holder" } } std::ifstream *ifstream_ptr; holder ifstream_holder; // { dg-final { whatis-test ifstream_holder "holder" } } std::ofstream *ofstream_ptr; holder ofstream_holder; // { dg-final { whatis-test ofstream_holder "holder" } } std::fstream *fstream_ptr; holder fstream_holder; // { dg-final { whatis-test fstream_holder "holder" } } std::streampos *streampos_ptr; holder streampos_holder; // { dg-final { whatis-test streampos_holder "holder" } } std::regex *regex_ptr; holder regex_holder; // { dg-final { whatis-test regex_holder "holder" } } std::csub_match *csub_match_ptr; holder csub_match_holder; // { dg-final { whatis-test csub_match_holder "holder" } } std::ssub_match *ssub_match_ptr; holder ssub_match_holder; // { dg-final { whatis-test ssub_match_holder "holder" } } std::cmatch *cmatch_ptr; holder cmatch_holder; // { dg-final { whatis-test cmatch_holder "holder" } } std::smatch *smatch_ptr; holder smatch_holder; // { dg-final { whatis-test smatch_holder "holder" } } std::cregex_iterator *cregex_iterator_ptr; holder cregex_iterator_holder; // { dg-final { whatis-test cregex_iterator_holder "holder" } } std::sregex_iterator *sregex_iterator_ptr; holder sregex_iterator_holder; // { dg-final { whatis-test sregex_iterator_holder "holder" } } std::cregex_token_iterator *cregex_token_iterator_ptr; holder cregex_token_iterator_holder; // { dg-final { whatis-test cregex_token_iterator_holder "holder" } } std::sregex_token_iterator *sregex_token_iterator_ptr; holder sregex_token_iterator_holder; // { dg-final { whatis-test sregex_token_iterator_holder "holder" } } std::u16string *u16string_ptr; holder u16string_holder; // { dg-final { whatis-test u16string_holder "holder" } } std::u32string *u32string_ptr; holder u32string_holder; // { dg-final { whatis-test u32string_holder "holder" } } std::minstd_rand0 *minstd_rand0_ptr; holder minstd_rand0_holder; // { dg-final { whatis-test minstd_rand0_holder "holder" } } std::minstd_rand *minstd_rand_ptr; holder minstd_rand_holder; // { dg-final { whatis-test minstd_rand_holder "holder" } } std::mt19937 *mt19937_ptr; holder mt19937_holder; // { dg-final { whatis-test mt19937_holder "holder" } } std::mt19937_64 *mt19937_64_ptr; holder mt19937_64_holder; // { dg-final { whatis-test mt19937_64_holder "holder" } } std::ranlux24_base *ranlux24_base_ptr; holder ranlux24_base_holder; // { dg-final { whatis-test ranlux24_base_holder "holder" } } std::ranlux48_base *ranlux48_base_ptr; holder ranlux48_base_holder; // { dg-final { whatis-test ranlux48_base_holder "holder" } } std::ranlux24 *ranlux24_ptr; holder ranlux24_holder; // { dg-final { whatis-test ranlux24_holder "holder" } } std::ranlux48 *ranlux48_ptr; holder ranlux48_holder; // { dg-final { whatis-test ranlux48_holder "holder" } } std::knuth_b *knuth_b_ptr; holder knuth_b_holder; // { dg-final { whatis-test knuth_b_holder "holder" } } std::vector>> *seq1_ptr; holder< std::vector>> > seq1_holder; // { dg-final { whatis-test seq1_holder "holder>> >" } } std::list>> *seq2_ptr; holder< std::list>> > seq2_holder; // { dg-final { whatis-test seq2_holder "holder>> >" } } std::map> *assoc1_ptr; holder< std::map> > assoc1_holder; // { dg-final { whatis-test assoc1_holder "holder> >" } } std::multimap> *assoc2_ptr; holder< std::multimap> > assoc2_holder; // { dg-final { whatis-test assoc2_holder "holder> >" } } std::unordered_map> *unord1_ptr; holder< std::unordered_map> > unord1_holder; // { dg-final { whatis-test unord1_holder "holder> >" } } std::unordered_multimap> *unord2_ptr; holder< std::unordered_multimap> > unord2_holder; // { dg-final { whatis-test unord2_holder "holder> >" } } placeholder(&ios_ptr); // Mark SPOT placeholder(&ios_holder); placeholder(&string_ptr); placeholder(&string_holder); placeholder(&streambuf_ptr); placeholder(&streambuf_holder); placeholder(&istream_ptr); placeholder(&istream_holder); placeholder(&ostream_ptr); placeholder(&ostream_holder); placeholder(&iostream_ptr); placeholder(&iostream_holder); placeholder(&stringbuf_ptr); placeholder(&stringbuf_holder); placeholder(&istringstream_ptr); placeholder(&istringstream_holder); placeholder(&ostringstream_ptr); placeholder(&ostringstream_holder); placeholder(&stringstream_ptr); placeholder(&stringstream_holder); placeholder(&filebuf_ptr); placeholder(&filebuf_holder); placeholder(&ifstream_ptr); placeholder(&ifstream_holder); placeholder(&ofstream_ptr); placeholder(&ofstream_holder); placeholder(&fstream_ptr); placeholder(&fstream_holder); placeholder(&streampos_ptr); placeholder(&streampos_holder); placeholder(®ex_ptr); placeholder(®ex_holder); placeholder(&csub_match_ptr); placeholder(&csub_match_holder); placeholder(&ssub_match_ptr); placeholder(&ssub_match_holder); placeholder(&cmatch_ptr); placeholder(&cmatch_holder); placeholder(&smatch_ptr); placeholder(&smatch_holder); placeholder(&cregex_iterator_ptr); placeholder(&cregex_iterator_holder); placeholder(&sregex_iterator_ptr); placeholder(&sregex_iterator_holder); placeholder(&cregex_token_iterator_ptr); placeholder(&cregex_token_iterator_holder); placeholder(&sregex_token_iterator_ptr); placeholder(&sregex_token_iterator_holder); placeholder(&u16string_ptr); placeholder(&u16string_holder); placeholder(&u32string_ptr); placeholder(&u32string_holder); placeholder(&minstd_rand0_ptr); placeholder(&minstd_rand0_holder); placeholder(&minstd_rand_ptr); placeholder(&minstd_rand_holder); placeholder(&mt19937_ptr); placeholder(&mt19937_holder); placeholder(&mt19937_64_ptr); placeholder(&mt19937_64_holder); placeholder(&ranlux24_base_ptr); placeholder(&ranlux24_base_holder); placeholder(&ranlux48_base_ptr); placeholder(&ranlux48_base_holder); placeholder(&ranlux24_ptr); placeholder(&ranlux24_holder); placeholder(&ranlux48_ptr); placeholder(&ranlux48_holder); placeholder(&knuth_b_ptr); placeholder(&knuth_b_holder); placeholder(&seq1_ptr); placeholder(&seq1_holder); placeholder(&seq2_ptr); placeholder(&seq2_holder); placeholder(&assoc1_ptr); placeholder(&assoc1_holder); placeholder(&assoc2_ptr); placeholder(&assoc2_holder); placeholder(&unord1_ptr); placeholder(&unord1_holder); placeholder(&unord2_ptr); placeholder(&unord2_holder); std::cout << "\n"; return 0; } // { dg-final { gdb-test SPOT } }