summaryrefslogtreecommitdiffstats
path: root/lld/unittests/DriverTests/UniversalDriverTest.cpp
diff options
context:
space:
mode:
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