[clang] [CIR] Upstream support for switch statements case kinds (PR #138003)

via cfe-commits cfe-commits at lists.llvm.org
Mon May 5 13:34:24 PDT 2025


================
@@ -112,24 +141,31 @@ int sw4(int a) {
 // CIR-NEXT:         }
 // CIR-NEXT:         cir.yield
 // CIR-NEXT:       }
+// CIR-NEXT:       cir.case(default, []) {
+// CIR-NEXT:         %5 = cir.const #cir.int<2> : !s32i
+// CIR-NEXT:         cir.store %5, %1 : !s32i, !cir.ptr<!s32i>
+// CIR-NEXT:         %6 = cir.load %1 : !cir.ptr<!s32i>, !s32i
+// CIR-NEXT:         cir.return %6 : !s32i
+// CIR-NEXT:       }
+// CIR-NEXT:       cir.yield
+// CIR-NEXT:       }
----------------
Andres-Salamanca wrote:

DONE

https://github.com/llvm/llvm-project/pull/138003


More information about the cfe-commits mailing list