|
发表于 2020-4-29 15:57:06
|
显示全部楼层
- #include <stdio.h>
- int main(void) {
- int b = 1;
- switch(b) {
- case 1: printf("1\n");
- default: printf("d\n");
- case 1 + 2: printf("3\n");
- }
- return 0;
- }
复制代码
- .file "main.c"
- .text
- .def __main; .scl 2; .type 32; .endef
- .section .rdata,"dr"
- .LC0:
- .ascii "1\0"
- .LC1:
- .ascii "d\0"
- .LC2:
- .ascii "3\0"
- .text
- .globl main
- .def main; .scl 2; .type 32; .endef
- .seh_proc main
- main:
- pushq %rbp
- .seh_pushreg %rbp
- movq %rsp, %rbp
- .seh_setframe %rbp, 0
- subq $48, %rsp
- .seh_stackalloc 48
- .seh_endprologue
- call __main
- movl $1, -4(%rbp)
- movl -4(%rbp), %eax
- cmpl $1, %eax
- je .L3
- cmpl $3, %eax
- je .L4
- jmp .L2
- .L3:
- leaq .LC0(%rip), %rcx
- call puts
- .L2:
- leaq .LC1(%rip), %rcx
- call puts
- .L4:
- leaq .LC2(%rip), %rcx
- call puts
- movl $0, %eax
- addq $48, %rsp
- popq %rbp
- ret
- .seh_endproc
- .ident "GCC: (GNU) 7.4.0"
- .def puts; .scl 2; .type 32; .endef
复制代码 |
|