Ticket #44129: test_libc++_stream.cc
File test_libc++_stream.cc, 492 bytes (added by michaelld (Michael Dickens), 10 years ago) |
---|
Line | |
---|---|
1 | // clang++ -Wall -stdlib=libc++ -o test_libc++_stream test_libc++_stream.cc |
2 | // ./test_libc++_stream |
3 | |
4 | #include <iostream> |
5 | #include <fstream> |
6 | #include <string> |
7 | |
8 | int main() |
9 | { |
10 | std::ifstream is("test_libc++_stream.cc"); |
11 | std::string line; |
12 | const int bufferSize = 11; |
13 | char buffer[bufferSize]; |
14 | is.getline(buffer, bufferSize); |
15 | std::cout << "libc++ is "; |
16 | if (is.gcount() != 10) { |
17 | std::cout << "NOT "; |
18 | } |
19 | std::cout << "OK: is.gcount() == " << is.gcount() << std::endl; |
20 | return 0; |
21 | } |