[gcov] Bump default version to 11.1
[llvm-project.git] / llvm / unittests / TargetParser / RISCVTargetParserTest.cpp
blob68338b569a20825f6d993f82f9ed09cd5a9dac4c
1 //===---- RISCVTargetParserTest.cpp - RISCVTargetParser 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 "llvm/TargetParser/RISCVTargetParser.h"
10 #include "gtest/gtest.h"
12 using namespace llvm;
14 namespace {
15 TEST(RISCVVType, CheckSameRatioLMUL) {
16 // Smaller LMUL.
17 EXPECT_EQ(RISCVII::LMUL_1,
18 RISCVVType::getSameRatioLMUL(16, RISCVII::LMUL_2, 8));
19 EXPECT_EQ(RISCVII::LMUL_F2,
20 RISCVVType::getSameRatioLMUL(16, RISCVII::LMUL_1, 8));
21 // Smaller fractional LMUL.
22 EXPECT_EQ(RISCVII::LMUL_F8,
23 RISCVVType::getSameRatioLMUL(16, RISCVII::LMUL_F4, 8));
24 // Bigger LMUL.
25 EXPECT_EQ(RISCVII::LMUL_2,
26 RISCVVType::getSameRatioLMUL(8, RISCVII::LMUL_1, 16));
27 EXPECT_EQ(RISCVII::LMUL_1,
28 RISCVVType::getSameRatioLMUL(8, RISCVII::LMUL_F2, 16));
29 // Bigger fractional LMUL.
30 EXPECT_EQ(RISCVII::LMUL_F2,
31 RISCVVType::getSameRatioLMUL(8, RISCVII::LMUL_F4, 16));
33 } // namespace