mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-01 13:17:01 +00:00
Simplify the PatternMatch unittest by giving it a module, function, and
basic block to hold instructions, and managing all of their lifetimes in a fixture. This makes it easy to sink the expectations into the test cases themselves which also makes things a bit more explicit and clearer IMO. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198532 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -13,253 +13,192 @@
|
|||||||
#include "llvm/IR/Constants.h"
|
#include "llvm/IR/Constants.h"
|
||||||
#include "llvm/IR/DataLayout.h"
|
#include "llvm/IR/DataLayout.h"
|
||||||
#include "llvm/IR/DerivedTypes.h"
|
#include "llvm/IR/DerivedTypes.h"
|
||||||
#include "llvm/IR/Instructions.h"
|
#include "llvm/IR/Function.h"
|
||||||
#include "llvm/IR/IRBuilder.h"
|
#include "llvm/IR/IRBuilder.h"
|
||||||
|
#include "llvm/IR/Instructions.h"
|
||||||
#include "llvm/IR/LLVMContext.h"
|
#include "llvm/IR/LLVMContext.h"
|
||||||
#include "llvm/IR/MDBuilder.h"
|
#include "llvm/IR/MDBuilder.h"
|
||||||
|
#include "llvm/IR/Module.h"
|
||||||
#include "llvm/IR/Operator.h"
|
#include "llvm/IR/Operator.h"
|
||||||
|
#include "llvm/IR/Type.h"
|
||||||
#include "llvm/Support/NoFolder.h"
|
#include "llvm/Support/NoFolder.h"
|
||||||
#include "llvm/Support/PatternMatch.h"
|
#include "llvm/Support/PatternMatch.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
using namespace llvm;
|
||||||
using namespace llvm::PatternMatch;
|
using namespace llvm::PatternMatch;
|
||||||
|
|
||||||
namespace llvm {
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
/// Ordered floating point minimum/maximum tests.
|
struct PatternMatchTest : ::testing::Test {
|
||||||
|
LLVMContext Ctx;
|
||||||
|
OwningPtr<Module> M;
|
||||||
|
Function *F;
|
||||||
|
BasicBlock *BB;
|
||||||
|
IRBuilder<true, NoFolder> Builder;
|
||||||
|
|
||||||
static void m_OrdFMin_expect_match_and_delete(Value *Cmp, Value *Select,
|
PatternMatchTest()
|
||||||
Value *L, Value *R) {
|
: M(new Module("PatternMatchTestModule", Ctx)),
|
||||||
Value *MatchL, *MatchR;
|
F(Function::Create(
|
||||||
EXPECT_TRUE(m_OrdFMin(m_Value(MatchL), m_Value(MatchR)).match(Select));
|
FunctionType::get(Type::getVoidTy(Ctx), /* IsVarArg */ false),
|
||||||
EXPECT_EQ(L, MatchL);
|
Function::ExternalLinkage, "f", M.get())),
|
||||||
EXPECT_EQ(R, MatchR);
|
BB(BasicBlock::Create(Ctx, "entry", F)), Builder(BB) {}
|
||||||
delete Select;
|
};
|
||||||
delete Cmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void m_OrdFMin_expect_nomatch_and_delete(Value *Cmp, Value *Select,
|
|
||||||
Value *L, Value *R) {
|
|
||||||
Value *MatchL, *MatchR;
|
|
||||||
EXPECT_FALSE(m_OrdFMin(m_Value(MatchL), m_Value(MatchR)).match(Select));
|
|
||||||
delete Select;
|
|
||||||
delete Cmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void m_OrdFMax_expect_match_and_delete(Value *Cmp, Value *Select,
|
|
||||||
Value *L, Value *R) {
|
|
||||||
Value *MatchL, *MatchR;
|
|
||||||
EXPECT_TRUE(m_OrdFMax(m_Value(MatchL), m_Value(MatchR)).match(Select));
|
|
||||||
EXPECT_EQ(L, MatchL);
|
|
||||||
EXPECT_EQ(R, MatchR);
|
|
||||||
delete Select;
|
|
||||||
delete Cmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void m_OrdFMax_expect_nomatch_and_delete(Value *Cmp, Value *Select,
|
|
||||||
Value *L, Value *R) {
|
|
||||||
Value *MatchL, *MatchR;
|
|
||||||
EXPECT_FALSE(m_OrdFMax(m_Value(MatchL), m_Value(MatchR)).match(Select));
|
|
||||||
delete Select;
|
|
||||||
delete Cmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TEST(PatternMatchTest, FloatingPointOrderedMin) {
|
|
||||||
LLVMContext &C(getGlobalContext());
|
|
||||||
IRBuilder<true, NoFolder> Builder(C);
|
|
||||||
|
|
||||||
|
TEST_F(PatternMatchTest, FloatingPointOrderedMin) {
|
||||||
Type *FltTy = Builder.getFloatTy();
|
Type *FltTy = Builder.getFloatTy();
|
||||||
Value *L = ConstantFP::get(FltTy, 1.0);
|
Value *L = ConstantFP::get(FltTy, 1.0);
|
||||||
Value *R = ConstantFP::get(FltTy, 2.0);
|
Value *R = ConstantFP::get(FltTy, 2.0);
|
||||||
|
Value *MatchL, *MatchR;
|
||||||
|
|
||||||
// Test OLT.
|
// Test OLT.
|
||||||
Value *Cmp = Builder.CreateFCmpOLT(L, R);
|
EXPECT_TRUE(m_OrdFMin(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Value *Select = Builder.CreateSelect(Cmp, L, R);
|
Builder.CreateSelect(Builder.CreateFCmpOLT(L, R), L, R)));
|
||||||
m_OrdFMin_expect_match_and_delete(Cmp, Select, L, R);
|
EXPECT_EQ(L, MatchL);
|
||||||
|
EXPECT_EQ(R, MatchR);
|
||||||
|
|
||||||
// Test OLE.
|
// Test OLE.
|
||||||
Cmp = Builder.CreateFCmpOLE(L, R);
|
EXPECT_TRUE(m_OrdFMin(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Select = Builder.CreateSelect(Cmp, L, R);
|
Builder.CreateSelect(Builder.CreateFCmpOLE(L, R), L, R)));
|
||||||
m_OrdFMin_expect_match_and_delete(Cmp, Select, L, R);
|
EXPECT_EQ(L, MatchL);
|
||||||
|
EXPECT_EQ(R, MatchR);
|
||||||
|
|
||||||
// Test no match on OGE.
|
// Test no match on OGE.
|
||||||
Cmp = Builder.CreateFCmpOGE(L, R);
|
EXPECT_FALSE(m_OrdFMin(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Select = Builder.CreateSelect(Cmp, L, R);
|
Builder.CreateSelect(Builder.CreateFCmpOGE(L, R), L, R)));
|
||||||
m_OrdFMin_expect_nomatch_and_delete(Cmp, Select, L, R);
|
|
||||||
|
|
||||||
// Test no match on OGT.
|
// Test no match on OGT.
|
||||||
Cmp = Builder.CreateFCmpOGT(L, R);
|
EXPECT_FALSE(m_OrdFMin(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Select = Builder.CreateSelect(Cmp, L, R);
|
Builder.CreateSelect(Builder.CreateFCmpOGT(L, R), L, R)));
|
||||||
m_OrdFMin_expect_nomatch_and_delete(Cmp, Select, L, R);
|
|
||||||
|
|
||||||
// Test match on OGE with inverted select.
|
// Test match on OGE with inverted select.
|
||||||
Cmp = Builder.CreateFCmpOGE(L, R);
|
EXPECT_TRUE(m_OrdFMin(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Select = Builder.CreateSelect(Cmp, R, L);
|
Builder.CreateSelect(Builder.CreateFCmpOGE(L, R), R, L)));
|
||||||
m_OrdFMin_expect_match_and_delete(Cmp, Select, L, R);
|
EXPECT_EQ(L, MatchL);
|
||||||
|
EXPECT_EQ(R, MatchR);
|
||||||
|
|
||||||
// Test match on OGT with inverted select.
|
// Test match on OGT with inverted select.
|
||||||
Cmp = Builder.CreateFCmpOGT(L, R);
|
EXPECT_TRUE(m_OrdFMin(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Select = Builder.CreateSelect(Cmp, R, L);
|
Builder.CreateSelect(Builder.CreateFCmpOGT(L, R), R, L)));
|
||||||
m_OrdFMin_expect_match_and_delete(Cmp, Select, L, R);
|
EXPECT_EQ(L, MatchL);
|
||||||
|
EXPECT_EQ(R, MatchR);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(PatternMatchTest, FloatingPointOrderedMax) {
|
TEST_F(PatternMatchTest, FloatingPointOrderedMax) {
|
||||||
LLVMContext &C(getGlobalContext());
|
|
||||||
IRBuilder<true, NoFolder> Builder(C);
|
|
||||||
|
|
||||||
Type *FltTy = Builder.getFloatTy();
|
Type *FltTy = Builder.getFloatTy();
|
||||||
Value *L = ConstantFP::get(FltTy, 1.0);
|
Value *L = ConstantFP::get(FltTy, 1.0);
|
||||||
Value *R = ConstantFP::get(FltTy, 2.0);
|
Value *R = ConstantFP::get(FltTy, 2.0);
|
||||||
|
Value *MatchL, *MatchR;
|
||||||
|
|
||||||
// Test OGT.
|
// Test OGT.
|
||||||
Value *Cmp = Builder.CreateFCmpOGT(L, R);
|
EXPECT_TRUE(m_OrdFMax(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Value *Select = Builder.CreateSelect(Cmp, L, R);
|
Builder.CreateSelect(Builder.CreateFCmpOGT(L, R), L, R)));
|
||||||
m_OrdFMax_expect_match_and_delete(Cmp, Select, L, R);
|
EXPECT_EQ(L, MatchL);
|
||||||
|
EXPECT_EQ(R, MatchR);
|
||||||
|
|
||||||
// Test OGE.
|
// Test OGE.
|
||||||
Cmp = Builder.CreateFCmpOGE(L, R);
|
EXPECT_TRUE(m_OrdFMax(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Select = Builder.CreateSelect(Cmp, L, R);
|
Builder.CreateSelect(Builder.CreateFCmpOGE(L, R), L, R)));
|
||||||
m_OrdFMax_expect_match_and_delete(Cmp, Select, L, R);
|
EXPECT_EQ(L, MatchL);
|
||||||
|
EXPECT_EQ(R, MatchR);
|
||||||
|
|
||||||
// Test no match on OLE.
|
// Test no match on OLE.
|
||||||
Cmp = Builder.CreateFCmpOLE(L, R);
|
EXPECT_FALSE(m_OrdFMax(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Select = Builder.CreateSelect(Cmp, L, R);
|
Builder.CreateSelect(Builder.CreateFCmpOLE(L, R), L, R)));
|
||||||
m_OrdFMax_expect_nomatch_and_delete(Cmp, Select, L, R);
|
|
||||||
|
|
||||||
// Test no match on OLT.
|
// Test no match on OLT.
|
||||||
Cmp = Builder.CreateFCmpOLT(L, R);
|
EXPECT_FALSE(m_OrdFMax(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Select = Builder.CreateSelect(Cmp, L, R);
|
Builder.CreateSelect(Builder.CreateFCmpOLT(L, R), L, R)));
|
||||||
m_OrdFMax_expect_nomatch_and_delete(Cmp, Select, L, R);
|
|
||||||
|
|
||||||
// Test match on OLE with inverted select.
|
// Test match on OLE with inverted select.
|
||||||
Cmp = Builder.CreateFCmpOLE(L, R);
|
EXPECT_TRUE(m_OrdFMax(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Select = Builder.CreateSelect(Cmp, R, L);
|
Builder.CreateSelect(Builder.CreateFCmpOLE(L, R), R, L)));
|
||||||
m_OrdFMax_expect_match_and_delete(Cmp, Select, L, R);
|
EXPECT_EQ(L, MatchL);
|
||||||
|
EXPECT_EQ(R, MatchR);
|
||||||
|
|
||||||
// Test match on OLT with inverted select.
|
// Test match on OLT with inverted select.
|
||||||
Cmp = Builder.CreateFCmpOLT(L, R);
|
EXPECT_TRUE(m_OrdFMax(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Select = Builder.CreateSelect(Cmp, R, L);
|
Builder.CreateSelect(Builder.CreateFCmpOLT(L, R), R, L)));
|
||||||
m_OrdFMax_expect_match_and_delete(Cmp, Select, L, R);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Unordered floating point minimum/maximum tests.
|
|
||||||
|
|
||||||
static void m_UnordFMin_expect_match_and_delete(Value *Cmp, Value *Select,
|
|
||||||
Value *L, Value *R) {
|
|
||||||
Value *MatchL, *MatchR;
|
|
||||||
EXPECT_TRUE(m_UnordFMin(m_Value(MatchL), m_Value(MatchR)).match(Select));
|
|
||||||
EXPECT_EQ(L, MatchL);
|
EXPECT_EQ(L, MatchL);
|
||||||
EXPECT_EQ(R, MatchR);
|
EXPECT_EQ(R, MatchR);
|
||||||
delete Select;
|
|
||||||
delete Cmp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void m_UnordFMin_expect_nomatch_and_delete(Value *Cmp, Value *Select,
|
TEST_F(PatternMatchTest, FloatingPointUnorderedMin) {
|
||||||
Value *L, Value *R) {
|
|
||||||
Value *MatchL, *MatchR;
|
|
||||||
EXPECT_FALSE(m_UnordFMin(m_Value(MatchL), m_Value(MatchR)).match(Select));
|
|
||||||
delete Select;
|
|
||||||
delete Cmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void m_UnordFMax_expect_match_and_delete(Value *Cmp, Value *Select,
|
|
||||||
Value *L, Value *R) {
|
|
||||||
Value *MatchL, *MatchR;
|
|
||||||
EXPECT_TRUE(m_UnordFMax(m_Value(MatchL), m_Value(MatchR)).match(Select));
|
|
||||||
EXPECT_EQ(L, MatchL);
|
|
||||||
EXPECT_EQ(R, MatchR);
|
|
||||||
delete Select;
|
|
||||||
delete Cmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void m_UnordFMax_expect_nomatch_and_delete(Value *Cmp, Value *Select,
|
|
||||||
Value *L, Value *R) {
|
|
||||||
Value *MatchL, *MatchR;
|
|
||||||
EXPECT_FALSE(m_UnordFMax(m_Value(MatchL), m_Value(MatchR)).match(Select));
|
|
||||||
delete Select;
|
|
||||||
delete Cmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(PatternMatchTest, FloatingPointUnorderedMin) {
|
|
||||||
LLVMContext &C(getGlobalContext());
|
|
||||||
IRBuilder<true, NoFolder> Builder(C);
|
|
||||||
|
|
||||||
Type *FltTy = Builder.getFloatTy();
|
Type *FltTy = Builder.getFloatTy();
|
||||||
Value *L = ConstantFP::get(FltTy, 1.0);
|
Value *L = ConstantFP::get(FltTy, 1.0);
|
||||||
Value *R = ConstantFP::get(FltTy, 2.0);
|
Value *R = ConstantFP::get(FltTy, 2.0);
|
||||||
|
Value *MatchL, *MatchR;
|
||||||
|
|
||||||
// Test ULT.
|
// Test ULT.
|
||||||
Value *Cmp = Builder.CreateFCmpULT(L, R);
|
EXPECT_TRUE(m_UnordFMin(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Value *Select = Builder.CreateSelect(Cmp, L, R);
|
Builder.CreateSelect(Builder.CreateFCmpULT(L, R), L, R)));
|
||||||
m_UnordFMin_expect_match_and_delete(Cmp, Select, L, R);
|
EXPECT_EQ(L, MatchL);
|
||||||
|
EXPECT_EQ(R, MatchR);
|
||||||
|
|
||||||
// Test ULE.
|
// Test ULE.
|
||||||
Cmp = Builder.CreateFCmpULE(L, R);
|
EXPECT_TRUE(m_UnordFMin(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Select = Builder.CreateSelect(Cmp, L, R);
|
Builder.CreateSelect(Builder.CreateFCmpULE(L, R), L, R)));
|
||||||
m_UnordFMin_expect_match_and_delete(Cmp, Select, L, R);
|
EXPECT_EQ(L, MatchL);
|
||||||
|
EXPECT_EQ(R, MatchR);
|
||||||
|
|
||||||
// Test no match on UGE.
|
// Test no match on UGE.
|
||||||
Cmp = Builder.CreateFCmpUGE(L, R);
|
EXPECT_FALSE(m_UnordFMin(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Select = Builder.CreateSelect(Cmp, L, R);
|
Builder.CreateSelect(Builder.CreateFCmpUGE(L, R), L, R)));
|
||||||
m_UnordFMin_expect_nomatch_and_delete(Cmp, Select, L, R);
|
|
||||||
|
|
||||||
// Test no match on UGT.
|
// Test no match on UGT.
|
||||||
Cmp = Builder.CreateFCmpUGT(L, R);
|
EXPECT_FALSE(m_UnordFMin(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Select = Builder.CreateSelect(Cmp, L, R);
|
Builder.CreateSelect(Builder.CreateFCmpUGT(L, R), L, R)));
|
||||||
m_UnordFMin_expect_nomatch_and_delete(Cmp, Select, L, R);
|
|
||||||
|
|
||||||
// Test match on UGE with inverted select.
|
// Test match on UGE with inverted select.
|
||||||
Cmp = Builder.CreateFCmpUGE(L, R);
|
EXPECT_TRUE(m_UnordFMin(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Select = Builder.CreateSelect(Cmp, R, L);
|
Builder.CreateSelect(Builder.CreateFCmpUGE(L, R), R, L)));
|
||||||
m_UnordFMin_expect_match_and_delete(Cmp, Select, L, R);
|
EXPECT_EQ(L, MatchL);
|
||||||
|
EXPECT_EQ(R, MatchR);
|
||||||
|
|
||||||
// Test match on UGT with inverted select.
|
// Test match on UGT with inverted select.
|
||||||
Cmp = Builder.CreateFCmpUGT(L, R);
|
EXPECT_TRUE(m_UnordFMin(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Select = Builder.CreateSelect(Cmp, R, L);
|
Builder.CreateSelect(Builder.CreateFCmpUGT(L, R), R, L)));
|
||||||
m_UnordFMin_expect_match_and_delete(Cmp, Select, L, R);
|
EXPECT_EQ(L, MatchL);
|
||||||
|
EXPECT_EQ(R, MatchR);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(PatternMatchTest, FloatingPointUnorderedMax) {
|
TEST_F(PatternMatchTest, FloatingPointUnorderedMax) {
|
||||||
LLVMContext &C(getGlobalContext());
|
|
||||||
IRBuilder<true, NoFolder> Builder(C);
|
|
||||||
|
|
||||||
Type *FltTy = Builder.getFloatTy();
|
Type *FltTy = Builder.getFloatTy();
|
||||||
Value *L = ConstantFP::get(FltTy, 1.0);
|
Value *L = ConstantFP::get(FltTy, 1.0);
|
||||||
Value *R = ConstantFP::get(FltTy, 2.0);
|
Value *R = ConstantFP::get(FltTy, 2.0);
|
||||||
|
Value *MatchL, *MatchR;
|
||||||
|
|
||||||
// Test UGT.
|
// Test UGT.
|
||||||
Value *Cmp = Builder.CreateFCmpUGT(L, R);
|
EXPECT_TRUE(m_UnordFMax(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Value *Select = Builder.CreateSelect(Cmp, L, R);
|
Builder.CreateSelect(Builder.CreateFCmpUGT(L, R), L, R)));
|
||||||
m_UnordFMax_expect_match_and_delete(Cmp, Select, L, R);
|
EXPECT_EQ(L, MatchL);
|
||||||
|
EXPECT_EQ(R, MatchR);
|
||||||
|
|
||||||
// Test UGE.
|
// Test UGE.
|
||||||
Cmp = Builder.CreateFCmpUGE(L, R);
|
EXPECT_TRUE(m_UnordFMax(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Select = Builder.CreateSelect(Cmp, L, R);
|
Builder.CreateSelect(Builder.CreateFCmpUGE(L, R), L, R)));
|
||||||
m_UnordFMax_expect_match_and_delete(Cmp, Select, L, R);
|
EXPECT_EQ(L, MatchL);
|
||||||
|
EXPECT_EQ(R, MatchR);
|
||||||
|
|
||||||
// Test no match on ULE.
|
// Test no match on ULE.
|
||||||
Cmp = Builder.CreateFCmpULE(L, R);
|
EXPECT_FALSE(m_UnordFMax(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Select = Builder.CreateSelect(Cmp, L, R);
|
Builder.CreateSelect(Builder.CreateFCmpULE(L, R), L, R)));
|
||||||
m_UnordFMax_expect_nomatch_and_delete(Cmp, Select, L, R);
|
|
||||||
|
|
||||||
// Test no match on ULT.
|
// Test no match on ULT.
|
||||||
Cmp = Builder.CreateFCmpULT(L, R);
|
EXPECT_FALSE(m_UnordFMax(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Select = Builder.CreateSelect(Cmp, L, R);
|
Builder.CreateSelect(Builder.CreateFCmpULT(L, R), L, R)));
|
||||||
m_UnordFMax_expect_nomatch_and_delete(Cmp, Select, L, R);
|
|
||||||
|
|
||||||
// Test match on ULE with inverted select.
|
// Test match on ULE with inverted select.
|
||||||
Cmp = Builder.CreateFCmpULE(L, R);
|
EXPECT_TRUE(m_UnordFMax(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Select = Builder.CreateSelect(Cmp, R, L);
|
Builder.CreateSelect(Builder.CreateFCmpULE(L, R), R, L)));
|
||||||
m_UnordFMax_expect_match_and_delete(Cmp, Select, L, R);
|
EXPECT_EQ(L, MatchL);
|
||||||
|
EXPECT_EQ(R, MatchR);
|
||||||
|
|
||||||
// Test match on ULT with inverted select.
|
// Test match on ULT with inverted select.
|
||||||
Cmp = Builder.CreateFCmpULT(L, R);
|
EXPECT_TRUE(m_UnordFMax(m_Value(MatchL), m_Value(MatchR)).match(
|
||||||
Select = Builder.CreateSelect(Cmp, R, L);
|
Builder.CreateSelect(Builder.CreateFCmpULT(L, R), R, L)));
|
||||||
m_UnordFMax_expect_match_and_delete(Cmp, Select, L, R);
|
EXPECT_EQ(L, MatchL);
|
||||||
|
EXPECT_EQ(R, MatchR);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // anonymous namespace.
|
} // anonymous namespace.
|
||||||
} // llvm namespace.
|
|
||||||
|
Reference in New Issue
Block a user