Skip to content

Commit a6d4ce0

Browse files
committed
fix CodeGenActionTest.cpp
1 parent 00fb7a0 commit a6d4ce0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

flang/unittests/Frontend/CodeGenActionTest.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ class FakeOp : public ::mlir::Op<FakeOp> {
5050

5151
static void build(
5252
::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState) {}
53+
54+
static FakeOp create(
55+
::mlir::OpBuilder &odsBuilder, ::mlir::Location location) {
56+
::mlir::OperationState state(location, getOperationName());
57+
build(odsBuilder, state);
58+
auto res = ::llvm::dyn_cast<FakeOp>(odsBuilder.create(state));
59+
assert(res && "builder didn't return the right type");
60+
return res;
61+
}
5362
};
5463
} // namespace dummy
5564
} // namespace test

0 commit comments

Comments
 (0)