summaryrefslogtreecommitdiff
path: root/unittests/Driver/UtilsTest.cpp
blob: 308e8d891099530806837537ca5a0b2564098e99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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));
  }
}