blob: 3c3848ffba4bc3e8edf0fe27ef56789d36bd6e96 [file] [log] [blame]
#include <iostream>
#include <fstream>
#include <string>
#include <errno.h>
#include <memory>
using namespace std;
struct foobar {
int x;
};
int main(void)
{
string line;
ifstream myfile;
/* grep the asm for M_release to verify we're using atomics */
std::shared_ptr<foobar> foo = make_shared<foobar>();
errno = 0;
myfile.open("hello.txt", ifstream::in);
if (errno)
perror("Unable to open (hello.txt):");
if (myfile.is_open()) {
while (myfile.good()) {
getline(myfile, line);
cout << line << endl;
}
myfile.close();
cout << "Stream test passed" << endl;
} else {
cout << "Unable to open file";
}
return 0;
}