[clang] [CIR] Upstream support for FlattenCFG switch and SwitchFlatOp (PR #139154)
Bruno Cardoso Lopes via cfe-commits
cfe-commits at lists.llvm.org
Fri May 9 11:37:06 PDT 2025
================
@@ -0,0 +1,68 @@
+// RUN: cir-opt %s | FileCheck %s
+!s32i = !cir.int<s, 32>
+
+cir.func @FlatSwitchWithoutDefault(%arg0: !s32i) {
+ cir.switch.flat %arg0 : !s32i, ^bb2 [
+ 1: ^bb1
+ ]
+ ^bb1:
+ cir.br ^bb2
+ ^bb2:
+ cir.return
+}
+
+// CHECK: cir.switch.flat %arg0 : !s32i, ^bb2 [
+// CHECK-NEXT: 1: ^bb1
+// CHECK-NEXT: ]
+// CHECK-NEXT: ^bb1:
+// CHECK-NEXT: cir.br ^bb2
+// CHECK-NEXT: ^bb2:
+//CHECK-NEXT: cir.return
----------------
bcardosolopes wrote:
Odd indentation compared with other check lines
https://github.com/llvm/llvm-project/pull/139154
More information about the cfe-commits
mailing list