From 8286ac511144e4f17d34eac9affb97e50646344a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 23 Jul 2014 15:25:44 +0200 Subject: Imported Upstream version 4.0.0 --- libcutl/tests/compiler/sloc-counter/driver.cxx | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 libcutl/tests/compiler/sloc-counter/driver.cxx (limited to 'libcutl/tests/compiler/sloc-counter/driver.cxx') diff --git a/libcutl/tests/compiler/sloc-counter/driver.cxx b/libcutl/tests/compiler/sloc-counter/driver.cxx new file mode 100644 index 0000000..504fbb7 --- /dev/null +++ b/libcutl/tests/compiler/sloc-counter/driver.cxx @@ -0,0 +1,36 @@ +// file : tests/compiler/sloc-counter/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#include +#include + +#include +#include + +using namespace std; +using namespace cutl::compiler; + +int +main (int argc, char* argv[]) +{ + if (argc != 2) + { + cerr << "usage: " << argv[0] << " " << endl; + return 1; + } + + ostream_filter filt (cout); + + ifstream ifs(argv[1]); + + for (istream::int_type c (ifs.get ()); + c != istream::traits_type::eof (); + c = ifs.get ()) + { + cout.put (istream::traits_type::to_char_type (c)); + } + + cout << endl + << filt.stream ().count () << endl; +} -- cgit v1.2.3