[lld] r199159 - [PECOFF] Add another test for the module-definition file parser.

Rui Ueyama ruiu at google.com
Mon Jan 13 14:55:09 PST 2014


Author: ruiu
Date: Mon Jan 13 16:55:09 2014
New Revision: 199159

URL: http://llvm.org/viewvc/llvm-project?rev=199159&view=rev
Log:
[PECOFF] Add another test for the module-definition file parser.

Modified:
    lld/trunk/unittests/DriverTests/WinLinkModuleDefTest.cpp

Modified: lld/trunk/unittests/DriverTests/WinLinkModuleDefTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/unittests/DriverTests/WinLinkModuleDefTest.cpp?rev=199159&r1=199158&r2=199159&view=diff
==============================================================================
--- lld/trunk/unittests/DriverTests/WinLinkModuleDefTest.cpp (original)
+++ lld/trunk/unittests/DriverTests/WinLinkModuleDefTest.cpp Mon Jan 13 16:55:09 2014
@@ -108,6 +108,17 @@ TEST_F(ParserTest, Name2) {
   EXPECT_EQ(4096U, name->getBaseAddress());
 }
 
+TEST_F(ParserTest, Name3) {
+  llvm::BumpPtrAllocator alloc;
+  llvm::Optional<moduledef::Directive *> dir = parse(
+      "NAME \"a long file name.exe\"", alloc);
+  EXPECT_TRUE(dir.hasValue());
+  auto *name = dyn_cast<moduledef::Name>(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<moduledef::Directive *> dir = parse("VERSION 12", alloc);





More information about the llvm-commits mailing list