mirror of
https://github.com/danog/ir.git
synced 2024-12-13 17:57:23 +01:00
63 lines
975 B
Plaintext
63 lines
975 B
Plaintext
|
--TEST--
|
||
|
SWITCH 001
|
||
|
--TARGET--
|
||
|
Windows-x86_64
|
||
|
--ARGS--
|
||
|
-S
|
||
|
--CODE--
|
||
|
{
|
||
|
uintptr_t c_1 = 0;
|
||
|
bool c_2 = 0;
|
||
|
bool c_3 = 1;
|
||
|
int32_t c_4 = 1;
|
||
|
int32_t c_5 = 2;
|
||
|
int32_t c_6 = 3;
|
||
|
int32_t c_7 = 4;
|
||
|
l_1 = START(l_16);
|
||
|
int32_t d_2 = PARAM(l_1, "z", 0);
|
||
|
l_4 = SWITCH(l_1, d_2);
|
||
|
l_5 = CASE_VAL(l_4, c_4);
|
||
|
int32_t x_1 = COPY(c_4);
|
||
|
l_6 = END(l_5);
|
||
|
l_7 = CASE_VAL(l_4, c_5);
|
||
|
int32_t x_2 = COPY(c_5);
|
||
|
l_8 = END(l_7);
|
||
|
l_9 = CASE_VAL(l_4, c_6);
|
||
|
int32_t x_3 = COPY(c_6);
|
||
|
l_10 = END(l_9);
|
||
|
l_11 = CASE_DEFAULT(l_4);
|
||
|
int32_t x_4 = COPY(c_7);
|
||
|
l_12 = END(l_11);
|
||
|
l_13 = MERGE/4(l_6, l_8, l_10, l_12);
|
||
|
int32_t ret = PHI/4(l_13, x_1, x_2, x_3, x_4);
|
||
|
l_16 = RETURN(l_13, ret);
|
||
|
}
|
||
|
--EXPECT--
|
||
|
test:
|
||
|
cmpl $3, %ecx
|
||
|
jg .L5
|
||
|
cmpl $1, %ecx
|
||
|
jl .L5
|
||
|
movslq %ecx, %rcx
|
||
|
leaq .L6(%rip), %rax
|
||
|
jmpq *-8(%rax, %rcx, 8)
|
||
|
.L1:
|
||
|
movl $1, %eax
|
||
|
.L2:
|
||
|
retq
|
||
|
.L3:
|
||
|
movl $2, %eax
|
||
|
jmp .L2
|
||
|
.L4:
|
||
|
movl $3, %eax
|
||
|
jmp .L2
|
||
|
.L5:
|
||
|
movl $4, %eax
|
||
|
jmp .L2
|
||
|
.rodata
|
||
|
.align 8
|
||
|
.L6:
|
||
|
.qword .L1
|
||
|
.qword .L3
|
||
|
.qword .L4
|