Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
ChuanqiXu9 committed Sep 25, 2024
1 parent 59b0f41 commit 4a3ebea
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions clang/test/CIR/CodeGen/goto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,3 +335,26 @@ extern "C" void case_follow_label(int v) {
// NOFLAT: case (default)
// NOFLAT: cir.call @action2()
// NOFLAT: cir.goto "label"

extern "C" void default_follow_label(int v) {
switch (v) {
case 1:
case 2:
action1();
break;
label:
default:
action2();
goto label;
}
}

// NOFLAT: cir.func @default_follow_label
// NOFLAT: cir.switch
// NOFLAT: case (anyof, [1, 2] : !s32i)
// NOFLAT: cir.call @action1()
// NOFLAT: cir.break
// NOFLAT: cir.label "label"
// NOFLAT: case (default)
// NOFLAT: cir.call @action2()
// NOFLAT: cir.goto "label"

0 comments on commit 4a3ebea

Please sign in to comment.