“fe3d90ba1f7c771f547ea9e7ecfe50a190317745”上不存在“...fluid/dygraph/git@gitcode.net:BaiXuePrincess/Paddle.git”
提交 6d671525 编写于 作者: F feilong

add compiler

上级 309f1aed
{
"type": "code_options",
"author": "幻灰龙",
"source": "compiler.md"
}
\ No newline at end of file
# 了解C编辑管道
一个典型的C程序编译管道,包含预处理、编译、汇编、链接四个环节。
![](https://userblink.csdnimg.cn/20211024/huanhuilong/pic/4d238ff624e5c015c216328a2be9bb5c-0.jpg?x-oss-process=image/interlace,1/format,jpg/resize,w_375)
假设输入文件是`helloworld.c`,使用GCC编译程序,编译命令是`gcc -Wall -save-temps helloworld.c -o helloworld`,那么下面哪个不是C程序处理管道产生的文件?
## template
```c
#include <stdio.h>
int main(int argc, char **argv) {
printf("Hello,World!");
return 0;
}
```
## 答案
```c
helloworld.txt
```
## 选项
### A
```c
helloworld.i
```
### B
```c
helloworld.s
```
### C
```c
helloworld.o
```
...@@ -94,6 +94,8 @@ ...@@ -94,6 +94,8 @@
} }
} }
], ],
"export": [], "export": [
"compiler.json"
],
"node_id": "be9d40c8fc0e49c9bbc1e3a0b60b7960" "node_id": "be9d40c8fc0e49c9bbc1e3a0b60b7960"
} }
\ No newline at end of file
#include <stdio.h>
int main(int argc, char **argv) {
printf("Hello,World!");
return 0;
}
\ No newline at end of file
.section __TEXT,__text,regular,pure_instructions
.build_version macos, 11, 0 sdk_version 11, 3
.globl _main ## -- Begin function main
.p2align 4, 0x90
_main: ## @main
.cfi_startproc
## %bb.0:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $32, %rsp
movl $0, -4(%rbp)
movl %edi, -8(%rbp)
movq %rsi, -16(%rbp)
leaq L_.str(%rip), %rdi
movb $0, %al
callq _printf
xorl %ecx, %ecx
movl %eax, -20(%rbp) ## 4-byte Spill
movl %ecx, %eax
addq $32, %rsp
popq %rbp
retq
.cfi_endproc
## -- End function
.section __TEXT,__cstring,cstring_literals
L_.str: ## @.str
.asciz "Hello,World!"
.subsections_via_symbols
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册