diff options
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
-rw-r--r-- | llvm/unittests/Support/CommandLineTest.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/unittests/Support/CommandLineTest.cpp b/llvm/unittests/Support/CommandLineTest.cpp index ba12c84..a296912 100644 --- a/llvm/unittests/Support/CommandLineTest.cpp +++ b/llvm/unittests/Support/CommandLineTest.cpp @@ -13,6 +13,7 @@ #include "llvm/ADT/Triple.h" #include "llvm/Config/config.h" #include "llvm/Support/FileSystem.h" +#include "llvm/Support/InitLLVM.h" #include "llvm/Support/Path.h" #include "llvm/Support/Program.h" #include "llvm/Support/StringSaver.h" @@ -821,4 +822,22 @@ TEST(CommandLineTest, PositionalEatArgsError) { EXPECT_TRUE(Errs.empty()); } +#ifdef _WIN32 +TEST(CommandLineTest, GetCommandLineArguments) { + int argc = __argc; + char **argv = __argv; + + // GetCommandLineArguments is called in InitLLVM. + llvm::InitLLVM X(argc, argv); + + EXPECT_EQ(llvm::sys::path::is_absolute(argv[0]), + llvm::sys::path::is_absolute(__argv[0])); + + EXPECT_TRUE(llvm::sys::path::filename(argv[0]) + .equals_lower("supporttests.exe")) + << "Filename of test executable is " + << llvm::sys::path::filename(argv[0]); +} +#endif + } // anonymous namespace |