summaryrefslogtreecommitdiffstats
path: root/lld/unittests/DriverTests/UniversalDriverTest.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2013-04-04 22:04:16 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2013-04-04 22:04:16 +0000
commitdfe85483d58170a5146990c3987e61b45bea413f (patch)
tree67aa4e666efb34ea97591cb2362e7c674e6a11e2 /lld/unittests/DriverTests/UniversalDriverTest.cpp
parentc451e5766e8b27f7ca55614364db0b101b729121 (diff)
downloadbcm5719-llvm-dfe85483d58170a5146990c3987e61b45bea413f.tar.gz
bcm5719-llvm-dfe85483d58170a5146990c3987e61b45bea413f.zip
[Driver] Fix symlinked universal driver behavior and add a test.
llvm-svn: 178798
Diffstat (limited to 'lld/unittests/DriverTests/UniversalDriverTest.cpp')
-rw-r--r--lld/unittests/DriverTests/UniversalDriverTest.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/lld/unittests/DriverTests/UniversalDriverTest.cpp b/lld/unittests/DriverTests/UniversalDriverTest.cpp
new file mode 100644
index 00000000000..e2fb1f25e21
--- /dev/null
+++ b/lld/unittests/DriverTests/UniversalDriverTest.cpp
@@ -0,0 +1,35 @@
+//===- lld/unittest/UniversalDriverTest.cpp -------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// \brief Universal driver tests that depend on the value of argv[0].
+///
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+
+#include "lld/Driver/Driver.h"
+
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/Support/raw_ostream.h"
+
+using namespace llvm;
+using namespace lld;
+
+TEST(UniversalDriver, flavor) {
+ const char *args[] = { "ld" };
+
+ std::string diags;
+ raw_string_ostream os(diags);
+ UniversalDriver::link(array_lengthof(args), args, os);
+ EXPECT_EQ(os.str().find("failed to determine driver flavor"),
+ std::string::npos);
+ EXPECT_NE(os.str().find("No input files"),
+ std::string::npos);
+}
OpenPOWER on IntegriCloud