mirror of https://github.com/rui314/chibicc
Make -E to imply -xc
This commit is contained in:
parent
ee0a951b30
commit
4064871212
4
main.c
4
main.c
|
@ -203,6 +203,10 @@ static void parse_args(int argc, char **argv) {
|
|||
|
||||
if (input_paths.len == 0)
|
||||
error("no input files");
|
||||
|
||||
// -E implies that the input is the C macro language.
|
||||
if (opt_E)
|
||||
opt_x = FILE_C;
|
||||
}
|
||||
|
||||
static FILE *open_file(char *path) {
|
||||
|
|
|
@ -198,4 +198,8 @@ echo 'int x;' > $tmp/foo.c
|
|||
$chibicc -c -x assembler -x none -o $tmp/foo.o $tmp/foo.c
|
||||
check '-x none'
|
||||
|
||||
# -E
|
||||
echo foo | $chibicc -E - | grep -q foo
|
||||
check -E
|
||||
|
||||
echo OK
|
||||
|
|
Loading…
Reference in New Issue