[llvm] [SandboxIR][NFC] Factor out common test for CastInst subclasses (PR #101410)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 31 15:22:52 PDT 2024
================
@@ -34,6 +34,8 @@ struct SandboxIRTest : public testing::Test {
return &BB;
llvm_unreachable("Expected to find basic block!");
}
+ template <typename SubclassT, sandboxir::Instruction::Opcode OpcodeT>
+ void testCastInst(const char *IRToParse, Type *SrcTy, Type *DstTy);
----------------
vporpo wrote:
> I kinda like making this a top level static template function and shuffling around some parameters (e.g. separating the parseIR and testCastInst, passing M to testCastInst), but up to you
This is what I was planning initially, which is why I placed the function right above the tests. Let me try it once again but this time I will make `parseIR()` a top level static function that returns the Module, so that I can use it from within the tests.
https://github.com/llvm/llvm-project/pull/101410
More information about the llvm-commits
mailing list