The switch doesn't match with any of the cases. It won't enter the main body.
To address your edit. Are you sure about your idea of the switch being compiled? I compiled this function with GCC and -02
typedef enum {
Test0 = 0,
Test1 = 1,
Test3 = 3
} TestEnum;
void myfunc(TestEnum a)
{
switch(a) {
case Test0: println("0"); break;
case Test1: println("1"); break;
case Test3: println("3"); break;
}
return;
}
The assembly is this:
.file "myfunc.c"
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "0"
.LC1:
.string "1"
.LC2:
.string "3"
.text
.p2align 4,,15
.globl myfunc
.type myfunc, @function
myfunc:
.LFB0:
.cfi_startproc
cmpl $1, %edi
je .L3
jb .L4
cmpl $3, %edi
jne .L8
movl $.LC2, %edi
xorl %eax, %eax
jmp println
.p2align 4,,10
.p2align 3
.L8:
rep ret
.p2align 4,,10
.p2align 3
.L4:
movl $.LC0, %edi
xorl %eax, %eax
jmp println
.p2align 4,,10
.p2align 3
.L3:
movl $.LC1, %edi
xorl %eax, %eax
jmp println
.cfi_endproc
.LFE0:
.size myfunc, .-myfunc
.ident "GCC: (GNU) 4.8.2 20140206 (prerelease)"
.section .note.GNU-stack,"",@progbits
You can see that it's doing compare and jumps. There is no indirect branches like you suspected.