[lld] r255822 - Fix DarwinLdDriverTest.cpp to pass real llvm options.

Pete Cooper via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 16 13:24:47 PST 2015


Author: pete
Date: Wed Dec 16 15:24:46 2015
New Revision: 255822

URL: http://llvm.org/viewvc/llvm-project?rev=255822&view=rev
Log:
Fix DarwinLdDriverTest.cpp to pass real llvm options.

After r255819, parse() actually parses what you pass it.

This test was failing because it passed '--debug-only' which isn't in
release builds, but also 'foo' which isn't an option at all.

We now pass -enable-tbaa and -enable-misched which are real options.

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

Modified: lld/trunk/unittests/DriverTests/DarwinLdDriverTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/unittests/DriverTests/DarwinLdDriverTest.cpp?rev=255822&r1=255821&r2=255822&view=diff
==============================================================================
--- lld/trunk/unittests/DriverTests/DarwinLdDriverTest.cpp (original)
+++ lld/trunk/unittests/DriverTests/DarwinLdDriverTest.cpp Wed Dec 16 15:24:46 2015
@@ -231,10 +231,10 @@ TEST_F(DarwinLdParserTest, deadStrippabl
 }
 
 TEST_F(DarwinLdParserTest, llvmOptions) {
-  EXPECT_TRUE(parse("ld", "-mllvm", "-debug-only", "-mllvm", "foo", "a.o",
+  EXPECT_TRUE(parse("ld", "-mllvm", "-enable-tbaa", "-mllvm", "-enable-misched", "a.o",
                     "-arch", "i386", nullptr));
   const std::vector<const char *> &options = _ctx.llvmOptions();
   EXPECT_EQ(options.size(), 2UL);
-  EXPECT_EQ(strcmp(options[0],"-debug-only"), 0);
-  EXPECT_EQ(strcmp(options[1],"foo"), 0);
+  EXPECT_EQ(strcmp(options[0],"-enable-tbaa"), 0);
+  EXPECT_EQ(strcmp(options[1],"-enable-misched"), 0);
 }




More information about the llvm-commits mailing list