ir/tests/debug/sccp_002.irt

82 lines
1.4 KiB
Plaintext
Raw Normal View History

2022-04-21 23:11:34 +02:00
--TEST--
SCCP 002
2022-05-25 16:38:22 +02:00
--TARGET--
x86_64
2022-04-21 23:11:34 +02:00
--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_38);
int32_t d_2 = PARAM(l_1, "z", 0);
bool d_3 = PARAM(l_1, "cond", 1);
l_4 = SWITCH(l_1, d_2);
l_5 = CASE_VAL(l_4, c_4);
l_6 = END(l_5);
l_7 = CASE_VAL(l_4, c_5);
l_8 = END(l_7);
l_9 = CASE_VAL(l_4, c_6);
l_10 = END(l_9);
l_11 = CASE_DEFAULT(l_4);
l_12 = END(l_11);
l_13 = LOOP_BEGIN(l_12, l_25);
int32_t d_14 = PHI(l_13, c_4, d_22);
bool d_15 = NE(d_14, c_4);
l_16 = IF(l_13, d_15);
l_17 = IF_TRUE(l_16);
l_18 = END(l_17);
l_19 = IF_FALSE(l_16);
l_20 = END(l_19);
l_21 = MERGE(l_18, l_20);
int32_t d_22 = PHI(l_21, c_5, d_14);
l_23 = IF(l_21, d_3);
l_24 = IF_TRUE(l_23);
l_25 = LOOP_END(l_24);
2022-04-21 23:11:34 +02:00
l_26 = IF_FALSE(l_23);
bool d_28 = EQ(d_22, c_4);
2022-06-15 16:27:31 +02:00
l_29 = IF(l_26, d_28);
2022-04-21 23:11:34 +02:00
l_30 = IF_TRUE(l_29);
l_31 = RETURN(l_30, d_22);
l_32 = IF_FALSE(l_29);
l_33 = END(l_32);
l_34 = MERGE/4(l_6, l_8, l_10, l_33);
int32_t d_36 = PHI/4(l_34, c_4, c_5, c_6, c_7);
l_38 = RETURN(l_34, d_36, l_31);
}
--EXPECT--
test:
cmpl $3, %edi
jg .L5
2022-04-21 23:11:34 +02:00
cmpl $1, %edi
jl .L5
2022-04-21 23:11:34 +02:00
movslq %edi, %rdi
leaq .L6(%rip), %rax
jmpq *-8(%rax, %rdi, 8)
.L1:
movl $1, %eax
.L2:
retq
.L3:
2022-04-21 23:11:34 +02:00
movl $2, %eax
jmp .L2
.L4:
2022-04-21 23:11:34 +02:00
movl $3, %eax
jmp .L2
.L5:
testb %sil, %sil
jne .L5
2022-04-21 23:11:34 +02:00
movl $1, %eax
retq
.rodata
.align 8
.L6:
.qword .L1
.qword .L3
.qword .L4