[llvm] [SandboxIR] Add test that checks if classof is missing. (PR #106313)

Jorge Gorbe Moya via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 28 10:44:15 PDT 2024


================
@@ -4213,3 +4213,10 @@ define void @foo() {
   EXPECT_EQ(NewUIEnd->getParent(), BB);
   EXPECT_EQ(NewUIEnd->getNextNode(), nullptr);
 }
+
+/// Makes sure that all Instruction sub-classes have a classof().
+TEST_F(SandboxIRTest, CheckClassof) {
+#define DEF_INSTR(ID, OPC, CLASS)                                              \
+  EXPECT_NE(&sandboxir::CLASS::classof, sandboxir::Instruction::classof);
----------------
slackito wrote:

nit: use `&` on `sandboxir::Instruction::classof` too, to make it consistent with the other side of the comparison?

https://github.com/llvm/llvm-project/pull/106313


More information about the llvm-commits mailing list