[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / llvm / unittests / Target / RISCV / RISCVBaseInfoTest.cpp
blob0e4c90caaaefd7dd1553ccd8938536b23264c9a2
1 //===- RISCVBaseInfoTest.cpp - RISCVBaseInfo unit tests ----------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "MCTargetDesc/RISCVBaseInfo.h"
11 #include "gtest/gtest.h"
13 using namespace llvm;
15 namespace {
16 TEST(RISCVBaseInfo, CheckSameRatioLMUL) {
17 // Smaller LMUL.
18 EXPECT_EQ(RISCVII::LMUL_1,
19 RISCVVType::getSameRatioLMUL(16, RISCVII::LMUL_2, 8));
20 EXPECT_EQ(RISCVII::LMUL_F2,
21 RISCVVType::getSameRatioLMUL(16, RISCVII::LMUL_1, 8));
22 // Smaller fractional LMUL.
23 EXPECT_EQ(RISCVII::LMUL_F8,
24 RISCVVType::getSameRatioLMUL(16, RISCVII::LMUL_F4, 8));
25 // Bigger LMUL.
26 EXPECT_EQ(RISCVII::LMUL_2,
27 RISCVVType::getSameRatioLMUL(8, RISCVII::LMUL_1, 16));
28 EXPECT_EQ(RISCVII::LMUL_1,
29 RISCVVType::getSameRatioLMUL(8, RISCVII::LMUL_F2, 16));
30 // Bigger fractional LMUL.
31 EXPECT_EQ(RISCVII::LMUL_F2,
32 RISCVVType::getSameRatioLMUL(8, RISCVII::LMUL_F4, 16));
34 } // namespace