aboutsummaryrefslogtreecommitdiff
path: root/mlir/test/CAPI/ir.c
diff options
context:
space:
mode:
authorRiver Riddle <riddleriver@gmail.com>2022-02-22 14:51:37 -0800
committerRiver Riddle <riddleriver@gmail.com>2023-06-09 11:30:13 -0700
commita5ef51d786f241cdd9d1bec62fbc2bf89a766b7d (patch)
tree1738495ab96392561800e95ab55cad544068c4bc /mlir/test/CAPI/ir.c
parentfb19fa2f3dfdd60d42c12ef28467d6f8f5149d6a (diff)
downloadllvm-a5ef51d786f241cdd9d1bec62fbc2bf89a766b7d.zip
llvm-a5ef51d786f241cdd9d1bec62fbc2bf89a766b7d.tar.gz
llvm-a5ef51d786f241cdd9d1bec62fbc2bf89a766b7d.tar.bz2
[mlir] Add support for "promised" interfaces
Promised interfaces allow for a dialect to "promise" the implementation of an interface, i.e. declare that it supports an interface, but have the interface defined in an extension in a library separate from the dialect itself. A promised interface is powerful in that it alerts the user when the interface is attempted to be used (e.g. via cast/dyn_cast/etc.) and the implementation has not yet been provided. This makes the system much more robust against misconfiguration, and ensures that we do not lose the benefit we currently have of defining the interface in the dialect library. Differential Revision: https://reviews.llvm.org/D120368
Diffstat (limited to 'mlir/test/CAPI/ir.c')
-rw-r--r--mlir/test/CAPI/ir.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mlir/test/CAPI/ir.c b/mlir/test/CAPI/ir.c
index 5d4d63c..00f2e8d 100644
--- a/mlir/test/CAPI/ir.c
+++ b/mlir/test/CAPI/ir.c
@@ -1725,10 +1725,10 @@ int registerOnlyStd(void) {
fprintf(stderr, "@registration\n");
// CHECK-LABEL: @registration
- // CHECK: cf.cond_br is_registered: 1
- fprintf(stderr, "cf.cond_br is_registered: %d\n",
+ // CHECK: func.call is_registered: 1
+ fprintf(stderr, "func.call is_registered: %d\n",
mlirContextIsRegisteredOperation(
- ctx, mlirStringRefCreateFromCString("cf.cond_br")));
+ ctx, mlirStringRefCreateFromCString("func.call")));
// CHECK: func.not_existing_op is_registered: 0
fprintf(stderr, "func.not_existing_op is_registered: %d\n",
@@ -1942,6 +1942,7 @@ int testClone(void) {
registerAllUpstreamDialects(ctx);
mlirContextGetOrLoadDialect(ctx, mlirStringRefCreateFromCString("func"));
+ mlirContextGetOrLoadDialect(ctx, mlirStringRefCreateFromCString("arith"));
MlirLocation loc = mlirLocationUnknownGet(ctx);
MlirType indexType = mlirIndexTypeGet(ctx);
MlirStringRef valueStringRef = mlirStringRefCreateFromCString("value");