Skip to content

Commit 656151f

Browse files
committed
[CIR][Interfaces] Temporarily disable verifier to get out of circular dep
1 parent dc5a7ae commit 656151f

File tree

3 files changed

+47
-45
lines changed

3 files changed

+47
-45
lines changed

clang/lib/CIR/Interfaces/CIRLoopOpInterface.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ void LoopOpInterface::getLoopOpSuccessorRegions(
4545

4646
/// Verify invariants of the LoopOpInterface.
4747
LogicalResult detail::verifyLoopOpInterface(Operation *op) {
48-
auto loopOp = cast<LoopOpInterface>(op);
49-
if (!isa<ConditionOp>(loopOp.getCond().back().getTerminator()))
50-
return op->emitOpError(
51-
"expected condition region to terminate with 'cir.condition'");
48+
// FIXME: fix this so the conditionop isn't requiring MLIRCIR
49+
// auto loopOp = cast<LoopOpInterface>(op);
50+
// if (!isa<ConditionOp>(loopOp.getCond().back().getTerminator()))
51+
// return op->emitOpError(
52+
// "expected condition region to terminate with 'cir.condition'");
5253
return success();
5354
}
5455

clang/test/CIR/IR/invalid.cir

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -303,23 +303,6 @@ cir.func @cast24(%p : !u32i) {
303303

304304
// -----
305305

306-
#false = #cir.bool<false> : !cir.bool
307-
#true = #cir.bool<true> : !cir.bool
308-
cir.func @b0() {
309-
cir.scope {
310-
cir.while { // expected-error {{expected condition region to terminate with 'cir.condition'}}
311-
cir.yield
312-
} do {
313-
cir.br ^bb1
314-
^bb1:
315-
cir.return
316-
}
317-
}
318-
cir.return
319-
}
320-
321-
// -----
322-
323306
!u32i = !cir.int<u, 32>
324307
!u8i = !cir.int<u, 8>
325308
module {
@@ -807,27 +790,3 @@ cir.func @const_type_mismatch() -> () {
807790
%2 = cir.const(#cir.int<0> : !s8i) : !u8i
808791
cir.return
809792
}
810-
811-
// -----
812-
813-
cir.func @invalid_cond_region_terminator(%arg0 : !cir.bool) -> !cir.void {
814-
cir.do { // expected-error {{op expected condition region to terminate with 'cir.condition'}}
815-
cir.yield
816-
} while {
817-
cir.yield
818-
}
819-
cir.return
820-
}
821-
822-
// -----
823-
824-
cir.func @invalidConditionTerminator (%arg0 : !cir.bool) -> !cir.void {
825-
cir.for : cond { // expected-error {{op expected condition region to terminate with 'cir.condition'}}
826-
cir.yield
827-
} body {
828-
cir.yield
829-
} step {
830-
cir.yield
831-
}
832-
cir.return
833-
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Test attempts to build bogus CIR
2+
// RUN: cir-opt %s -verify-diagnostics -split-input-file
3+
// XFAIL: *
4+
5+
#false = #cir.bool<false> : !cir.bool
6+
#true = #cir.bool<true> : !cir.bool
7+
cir.func @b0() {
8+
cir.scope {
9+
cir.while { // expected-error {{expected condition region to terminate with 'cir.condition'}}
10+
cir.yield
11+
} do {
12+
cir.br ^bb1
13+
^bb1:
14+
cir.return
15+
}
16+
}
17+
cir.return
18+
}
19+
20+
// -----
21+
22+
cir.func @invalid_cond_region_terminator(%arg0 : !cir.bool) -> !cir.void {
23+
cir.do { // expected-error {{op expected condition region to terminate with 'cir.condition'}}
24+
cir.yield
25+
} while {
26+
cir.yield
27+
}
28+
cir.return
29+
}
30+
31+
// -----
32+
33+
cir.func @invalidConditionTerminator (%arg0 : !cir.bool) -> !cir.void {
34+
cir.for : cond { // expected-error {{op expected condition region to terminate with 'cir.condition'}}
35+
cir.yield
36+
} body {
37+
cir.yield
38+
} step {
39+
cir.yield
40+
}
41+
cir.return
42+
}

0 commit comments

Comments
 (0)