summaryrefslogtreecommitdiffstats
path: root/lld/unittests/DriverTests/DarwinLdDriverTest.cpp
diff options
context:
space:
mode:
authorNick Kledzik <kledzik@apple.com>2013-09-10 23:55:14 +0000
committerNick Kledzik <kledzik@apple.com>2013-09-10 23:55:14 +0000
commite773e327d3c27ffad1fca361a21f53c90a97f3b9 (patch)
tree185621e57924ea255c1b3df6fea574a9281132fc /lld/unittests/DriverTests/DarwinLdDriverTest.cpp
parente850d9dedd29ea7f92274f62aedf6c4f751008cb (diff)
downloadbcm5719-llvm-e773e327d3c27ffad1fca361a21f53c90a97f3b9.tar.gz
bcm5719-llvm-e773e327d3c27ffad1fca361a21f53c90a97f3b9.zip
Support darwin linker options:
-current_version, -compatibility_version, and -install_name. Patch by Joe Ranieri llvm-svn: 190452
Diffstat (limited to 'lld/unittests/DriverTests/DarwinLdDriverTest.cpp')
-rw-r--r--lld/unittests/DriverTests/DarwinLdDriverTest.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/lld/unittests/DriverTests/DarwinLdDriverTest.cpp b/lld/unittests/DriverTests/DarwinLdDriverTest.cpp
index 70dcba1756a..494c877b4a5 100644
--- a/lld/unittests/DriverTests/DarwinLdDriverTest.cpp
+++ b/lld/unittests/DriverTests/DarwinLdDriverTest.cpp
@@ -169,4 +169,56 @@ TEST_F(DarwinLdParserTest, iOS_Simulator6) {
EXPECT_TRUE(_context.minOS("", "6.0"));
}
+TEST_F(DarwinLdParserTest, compatibilityVersion) {
+ EXPECT_FALSE(
+ parse("ld", "-dylib", "-compatibility_version", "1.2.3", "a.o", nullptr));
+ EXPECT_EQ(_context.compatibilityVersion(), 0x10203U);
+}
+
+TEST_F(DarwinLdParserTest, compatibilityVersionInvalidType) {
+ EXPECT_TRUE(parse("ld", "-bundle", "-compatibility_version", "1.2.3", "a.o",
+ nullptr));
+}
+
+TEST_F(DarwinLdParserTest, compatibilityVersionInvalidValue) {
+ EXPECT_TRUE(parse("ld", "-bundle", "-compatibility_version", "1,2,3", "a.o",
+ nullptr));
+}
+
+TEST_F(DarwinLdParserTest, currentVersion) {
+ EXPECT_FALSE(
+ parse("ld", "-dylib", "-current_version", "1.2.3", "a.o", nullptr));
+ EXPECT_EQ(_context.currentVersion(), 0x10203U);
+}
+
+TEST_F(DarwinLdParserTest, currentVersionInvalidType) {
+ EXPECT_TRUE(
+ parse("ld", "-bundle", "-current_version", "1.2.3", "a.o", nullptr));
+}
+
+TEST_F(DarwinLdParserTest, currentVersionInvalidValue) {
+ EXPECT_TRUE(
+ parse("ld", "-bundle", "-current_version", "1,2,3", "a.o", nullptr));
+}
+
+TEST_F(DarwinLdParserTest, bundleLoader) {
+ EXPECT_FALSE(
+ parse("ld", "-bundle", "-bundle_loader", "/bin/ls", "a.o", nullptr));
+ EXPECT_EQ(_context.bundleLoader(), "/bin/ls");
+}
+
+TEST_F(DarwinLdParserTest, bundleLoaderInvalidType) {
+ EXPECT_TRUE(parse("ld", "-bundle_loader", "/bin/ls", "a.o", nullptr));
+}
+
+TEST_F(DarwinLdParserTest, deadStrippableDylib) {
+ EXPECT_FALSE(
+ parse("ld", "-dylib", "-mark_dead_strippable_dylib", "a.o", nullptr));
+ EXPECT_EQ(true, _context.deadStrippableDylib());
+}
+
+TEST_F(DarwinLdParserTest, deadStrippableDylibInvalidType) {
+ EXPECT_TRUE(parse("ld", "-mark_dead_strippable_dylib", "a.o", nullptr));
+}
+
} // end anonymous namespace
OpenPOWER on IntegriCloud