Skip to content

Commit 5d8da83

Browse files
committed
[FIRRTL] Add bind-op verifier error tests
1 parent fc40e4c commit 5d8da83

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/Dialect/FIRRTL/errors.mlir

+28
Original file line numberDiff line numberDiff line change
@@ -2885,3 +2885,31 @@ firrtl.circuit "SimulationPortType3" {
28852885
out success: !firrtl.reset
28862886
)
28872887
}
2888+
2889+
// -----
2890+
2891+
firrtl.circuit "BindTargetMissingModule" {
2892+
firrtl.module @BindTargetMissing() {}
2893+
// expected-error @below {{Referenced module doesn't exist "XXX"::"YYY}}
2894+
firrtl.bind <@XXX::@YYY>
2895+
}
2896+
2897+
// -----
2898+
2899+
firrtl.circuit "BindTargetMissingInstance" {
2900+
firrtl.module @BindTargetMissingInstance() {}
2901+
// expected-error @below {{Referenced instance doesn't exist "BindTargetMissingInstance"::"YYY"}}
2902+
firrtl.bind <@BindTargetMissingInstance::@YYY>
2903+
}
2904+
2905+
// -----
2906+
2907+
firrtl.circuit "BindTargetMissingDoNotPrintFlag" {
2908+
firrtl.module @Target() {}
2909+
firrtl.module @BindTargetMissingDoNotPrintFlag() {
2910+
firrtl.instance target sym @target @Target()
2911+
}
2912+
2913+
// expected-error @below {{Referenced instance isn't marked as doNotPrint}}
2914+
firrtl.bind <@BindTargetMissingDoNotPrintFlag::@target>
2915+
}

0 commit comments

Comments
 (0)