summaryrefslogtreecommitdiff
path: root/unittests/Driver
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-07-10 18:38:38 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-07-10 18:38:38 +0000
commitc5cc701d09b5be6d250d8369f96d3766f574a94e (patch)
treecf907e6e5284013a0ccee1fe2ce6feacab7db3c2 /unittests/Driver
parentec81a0dc9e7ac324e01ff9d5c69b99fee47ca10d (diff)
downloadclang-c5cc701d09b5be6d250d8369f96d3766f574a94e.tar.gz
[Driver/Unittests] Follow up for r212666, add unit test for the newly exposed getARMCPUForMArch() function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212751 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Driver')
-rw-r--r--unittests/Driver/CMakeLists.txt1
-rw-r--r--unittests/Driver/UtilsTest.cpp31
2 files changed, 32 insertions, 0 deletions
diff --git a/unittests/Driver/CMakeLists.txt b/unittests/Driver/CMakeLists.txt
index 8cc963b33a..106f070bbf 100644
--- a/unittests/Driver/CMakeLists.txt
+++ b/unittests/Driver/CMakeLists.txt
@@ -4,6 +4,7 @@ set(LLVM_LINK_COMPONENTS
add_clang_unittest(ClangDriverTests
MultilibTest.cpp
+ UtilsTest.cpp
)
target_link_libraries(ClangDriverTests
diff --git a/unittests/Driver/UtilsTest.cpp b/unittests/Driver/UtilsTest.cpp
new file mode 100644
index 0000000000..308e8d8910
--- /dev/null
+++ b/unittests/Driver/UtilsTest.cpp
@@ -0,0 +1,31 @@
+//===- unittests/Driver/UtilsTest.cpp --- Utils tests ---------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Unit tests for Driver/Util API.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/Driver/Util.h"
+#include "clang/Basic/LLVM.h"
+#include "llvm/ADT/Triple.h"
+#include "gtest/gtest.h"
+
+using namespace clang::driver;
+using namespace clang;
+
+TEST(UtilsTest, getARMCPUForMArch) {
+ {
+ llvm::Triple Triple("armv7s-apple-ios7");
+ EXPECT_STREQ("swift", getARMCPUForMArch(Triple.getArchName(), Triple));
+ }
+ {
+ llvm::Triple Triple("armv7-apple-ios7");
+ EXPECT_STREQ("cortex-a8", getARMCPUForMArch(Triple.getArchName(), Triple));
+ }
+}