llvm/llvm/unittests/IR/VFABIDemanglerTest.cpp

//===------- VFABIDemanglerTest.cpp - VFABI unit tests  -------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "llvm/IR/VFABIDemangler.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Analysis/VectorUtils.h"
#include "llvm/AsmParser/Parser.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/SourceMgr.h"
#include "gtest/gtest.h"
#include <optional>

usingnamespacellvm;

namespace {

static LLVMContext Ctx;

/// Perform tests against VFABI Rules. `invokeParser` creates a VFInfo object
/// and a scalar FunctionType, which are used by tests to check that:
/// 1. The scalar and vector names are correct.
/// 2. The number of parameters from the parsed mangled name matches the number
///    of arguments in the scalar function passed as FunctionType string.
/// 3. The number of vector parameters and their types match the values
///    specified in the test.
///    On masked functions it also checks that the last parameter is a mask (ie,
///    GlobalPredicate).
/// 4. The vector function is correctly found to have a mask.
///
class VFABIParserTest : public ::testing::Test {};
} // unnamed namespace

// Function Types commonly used in tests
FunctionType *FTyMaskVLen2_i32 =;

FunctionType *FTyNoMaskVLen2_i32 =;

FunctionType *FTyMaskedVLA_i32 =;

// This test makes sure that the demangling method succeeds only on
// valid values of the string.
TEST_F(VFABIParserTest, OnlyValidNames) {}

TEST_F(VFABIParserTest, ParamListParsing) {}

TEST_F(VFABIParserTest, ScalarNameAndVectorName_01) {}

TEST_F(VFABIParserTest, ScalarNameAndVectorName_02) {}

TEST_F(VFABIParserTest, ScalarNameAndVectorName_03) {}

TEST_F(VFABIParserTest, ScalarNameOnly) {}

TEST_F(VFABIParserTest, Parse) {}

TEST_F(VFABIParserTest, ParseVectorName) {}

TEST_F(VFABIParserTest, LinearWithCompileTimeNegativeStep) {}

TEST_F(VFABIParserTest, ParseScalableSVE) {}

TEST_F(VFABIParserTest, ParseFixedWidthSVE) {}

TEST_F(VFABIParserTest, NotAVectorFunctionABIName) {}

TEST_F(VFABIParserTest, LinearWithRuntimeStep) {}

TEST_F(VFABIParserTest, LinearWithoutCompileTime) {}

TEST_F(VFABIParserTest, LLVM_ISA) {}

TEST_F(VFABIParserTest, InvalidMask) {}

TEST_F(VFABIParserTest, InvalidParameter) {}

TEST_F(VFABIParserTest, Align) {}

TEST_F(VFABIParserTest, ParseUniform) {}

TEST_F(VFABIParserTest, ISAIndependentMangling) {}

TEST_F(VFABIParserTest, MissingScalarName) {}

TEST_F(VFABIParserTest, MissingVectorName) {}

TEST_F(VFABIParserTest, MissingVectorNameTermination) {}

TEST_F(VFABIParserTest, ParseMaskingNEON) {}

TEST_F(VFABIParserTest, ParseMaskingSVE) {}

TEST_F(VFABIParserTest, ParseMaskingSSE) {}

TEST_F(VFABIParserTest, ParseMaskingAVX) {}

TEST_F(VFABIParserTest, ParseMaskingAVX2) {}

TEST_F(VFABIParserTest, ParseMaskingAVX512) {}

TEST_F(VFABIParserTest, ParseMaskingLLVM) {}

TEST_F(VFABIParserTest, ParseScalableMaskingLLVM) {}

TEST_F(VFABIParserTest, LLVM_InternalISA) {}

TEST_F(VFABIParserTest, LLVM_Intrinsics) {}

TEST_F(VFABIParserTest, ParseScalableRequiresDeclaration) {}

TEST_F(VFABIParserTest, ZeroIsInvalidVLEN) {}

TEST_F(VFABIParserTest, ParseScalableMaskingSVE) {}

TEST_F(VFABIParserTest, ParseScalableMaskingSVESincos) {}

// Make sure that we get the correct VF if the return type is wider than any
// parameter type.
TEST_F(VFABIParserTest, ParseWiderReturnTypeSVE) {}

// Make sure we handle void return types.
TEST_F(VFABIParserTest, ParseVoidReturnTypeSVE) {}

// Make sure we reject unsupported parameter types.
TEST_F(VFABIParserTest, ParseUnsupportedElementTypeSVE) {}

// Make sure we reject unsupported return types
TEST_F(VFABIParserTest, ParseUnsupportedReturnTypeSVE) {}

class VFABIAttrTest : public testing::Test {};

TEST_F(VFABIAttrTest, Read) {}

TEST_F(VFABIAttrTest, Write) {}

static std::unique_ptr<Module> parseIR(LLVMContext &C, const char *IR) {}

TEST(VFABIGetMappingsTest, IndirectCallInst) {}