Files
c3c/test/test_suite/statements/defer_next_switch.c3t

51 lines
736 B
C

func void test1()
{}
func void test2()
{}
func void test(int i)
{
bool b = true;
switch (i)
{
case 1:
defer test2();
if (b) nextcase;
test1();
case 2:
test1();
}
}
// #expect: defer_next_switch.ll
switch.case:
%3 = load i8, i8* %b, align 1
%4 = trunc i8 %3 to i1
br i1 %4, label %if.then, label %if.exit
if.then:
call void @defer_next_switch.test2()
br label %exit
exit:
br label %switch.case2
if.exit:
call void @defer_next_switch.test1()
call void @defer_next_switch.test2()
br label %exit1
exit1:
br label %switch.exit
switch.case2:
call void @defer_next_switch.test1()
br label %switch.exit
switch.exit:
ret void
}