diff --git a/lld/unittests/DriverTests/WinLinkModuleDefTest.cpp b/lld/unittests/DriverTests/WinLinkModuleDefTest.cpp index a38827a4a320..d377c9aa2cea 100644 --- a/lld/unittests/DriverTests/WinLinkModuleDefTest.cpp +++ b/lld/unittests/DriverTests/WinLinkModuleDefTest.cpp @@ -108,6 +108,17 @@ TEST_F(ParserTest, Name2) { EXPECT_EQ(4096U, name->getBaseAddress()); } +TEST_F(ParserTest, Name3) { + llvm::BumpPtrAllocator alloc; + llvm::Optional dir = parse( + "NAME \"a long file name.exe\"", alloc); + EXPECT_TRUE(dir.hasValue()); + auto *name = dyn_cast(dir.getValue()); + EXPECT_TRUE(name != nullptr); + EXPECT_EQ("a long file name.exe", name->getOutputPath()); + EXPECT_EQ(0U, name->getBaseAddress()); +} + TEST_F(ParserTest, Version1) { llvm::BumpPtrAllocator alloc; llvm::Optional dir = parse("VERSION 12", alloc);