[LIT] Nested region matching in MLIR

I am right now working with multiple nested regions and would like to construct a set of LIT tests. Is there an easy way to identify the unique end of a region in MLIR? Or is there an alternative solution for FileCheck?

The use-case has an arbitrary level of nestings similar to the example below.

%0 = graph ( … ) attributes { … } {
%1 = graph ( … ) attributes { … } {

}
}

So far I have tried implementing LIT tests through CHECK and CHECK-SAME to identify the beginning of a graph region and wildcards to match accordingly.

Any help is highly appreciated :pray: