diff options
author | Johnny Chen <johnny.chen@apple.com> | 2010-09-15 22:48:40 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2010-09-15 22:48:40 +0000 |
commit | f7f627104b471a4daa5b61b6bbf85240c0c61421 (patch) | |
tree | 48e5ea0ace34a9cde61a7ae1f75b6588c5cc96b1 | |
parent | 33e7e5d89bbcbbed862821fccb98018fe116b99d (diff) | |
download | bcm5719-llvm-f7f627104b471a4daa5b61b6bbf85240c0c61421.tar.gz bcm5719-llvm-f7f627104b471a4daa5b61b6bbf85240c0c61421.zip |
Simplied main() and emits a message to the standard out.
llvm-svn: 114033
-rw-r--r-- | lldb/test/settings/main.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lldb/test/settings/main.cpp b/lldb/test/settings/main.cpp index b2acd64cb22..94a4830ad6b 100644 --- a/lldb/test/settings/main.cpp +++ b/lldb/test/settings/main.cpp @@ -10,26 +10,23 @@ #include <cstdlib> #include <string> #include <fstream> +#include <iostream> int main(int argc, char const *argv[]) { - char const *cptr = NULL; // The program writes its output to the "output.txt" file. std::ofstream outfile("output.txt"); - for (unsigned i = 0, e = sizeof(argv); i < e; ++i) { - if ((cptr = argv[i]) == NULL) - break; - - std::string str(cptr); - if (i == 1 && "A" == str) + for (unsigned i = 0; i < argc; ++i) { + std::string theArg(argv[i]); + if (i == 1 && "A" == theArg) outfile << "argv[1] matches\n"; - if (i == 2 && "B" == str) + if (i == 2 && "B" == theArg) outfile << "argv[2] matches\n"; - if (i == 3 && "C" == str) + if (i == 3 && "C" == theArg) outfile << "argv[3] matches\n"; } @@ -40,5 +37,7 @@ main(int argc, char const *argv[]) } } + std::cout << "This message should go to standard out.\n"; + return 0; } |