diff --git a/repos/libports/lib/symbols/stdcxx b/repos/libports/lib/symbols/stdcxx index 08db6b3c8..cf25efc27 100644 --- a/repos/libports/lib/symbols/stdcxx +++ b/repos/libports/lib/symbols/stdcxx @@ -152,6 +152,8 @@ _ZNKSt9type_info10__do_catchEPKS_PPvj T _ZNKSt9type_info11__do_upcastEPKN10__cxxabiv117__class_type_infoEPPv T _ZNKSt9type_info14__is_pointer_pEv T _ZNKSt9type_info15__is_function_pEv T +_ZNSi6ignoreEl T +_ZNSi6ignoreEli T _ZNSt10__num_base11_S_atoms_inE D 8 _ZNSt10__num_base12_S_atoms_outE D 8 _ZNSt10__num_base15_S_format_floatERKSt8ios_basePcc T diff --git a/repos/libports/run/stdcxx.run b/repos/libports/run/stdcxx.run index a1e151af6..0069642d0 100644 --- a/repos/libports/run/stdcxx.run +++ b/repos/libports/run/stdcxx.run @@ -45,5 +45,7 @@ compare_output_to { [init -> test-stdcxx] 456 [init -> test-stdcxx] 7.8 [init -> test-stdcxx] caught std::invalid_argument +[init -> test-stdcxx] 1 +[init -> test-stdcxx] 2 [init -> test-stdcxx] ° °° °°° test-stdcxx finished °°° °° ° } diff --git a/repos/libports/src/test/stdcxx/main.cc b/repos/libports/src/test/stdcxx/main.cc index 49b2281c5..ad892b8ff 100644 --- a/repos/libports/src/test/stdcxx/main.cc +++ b/repos/libports/src/test/stdcxx/main.cc @@ -84,6 +84,31 @@ static void test_lock_guard() } +#include +#include +#include + +static void test_ignore() +{ + std::istringstream input("1\n" + "some non-numeric input\n" + "2\n"); + for (;;) { + int n; + input >> n; + + if (input.eof() || input.bad()) { + break; + } else if (input.fail()) { + input.clear(); /* unset failbit */ + input.ignore(std::numeric_limits::max(), '\n'); /* skip bad input */ + } else { + std::cout << n << '\n'; + } + } +} + + int main(int argc, char **argv) { std::cout << "° °° °°° test-stdcxx started °°° °° °" << std::endl; @@ -92,6 +117,7 @@ int main(int argc, char **argv) test_cstdlib(); test_stdexcept(); test_lock_guard(); + test_ignore(); std::cout << "° °° °°° test-stdcxx finished °°° °° °" << std::endl; }