================
@@ -36,3 +36,33 @@ cir.func @s0() {
// CHECK-NEXT: }
// CHECK-NEXT: cir.yield
// CHECK-NEXT: }
+
+
+// Pretends that this is lowered from a C file and was tagged with
allEnumCasesCovered = true
+cir.func @s1(%1 : !s32i) {
+ cir.switch (%1 : !s32i) {
+ cir.case (default, []) {
+ cir.return
+ }
+ cir.case (equal, [#cir.int<1> : !s32i]) {
+ cir.yield
+ }
+ cir.case (equal, [#cir.int<2> : !s32i]) {
+ cir.yield
+ }
+ cir.yield
+ } { allEnumCasesCovered = true}
+ cir.return
+}
+// CHECK: cir.switch (%arg0 : !s32i) {
+// CHECK-NEXT: cir.case(default, []) {
+// CHECK-NEXT: cir.return
+// CHECK-NEXT: }
+// CHECK-NEXT: cir.case(equal, [#cir.int<1> : !s32i]) {
+// CHECK-NEXT: cir.yield
+// CHECK-NEXT: }
+// CHECK-NEXT: cir.case(equal, [#cir.int<2> : !s32i]) {
+// CHECK-NEXT: cir.yield
+// CHECK-NEXT: }
+// CHECK-NEXT: cir.yield
+// CHECK-NEXT: } {allEnumCasesCovered = true}
----------------
andykaylor wrote:
I expected the attribute to be printed before the region, but I'm honestly not
sure if there's an MLIR standard for that. I guess since you didn't add any
code to print it this must be the default behavior.
@xlauko Does this look right to you?
https://github.com/llvm/llvm-project/pull/171246
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits