mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
LLVMC2: Teach llvm_gcc_c tool about -include and -fsyntax-only.
- Only focusing on llvm_gcc_c for now, eventually this needs to be refactored so it can be shared via all the gcc-like tools. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59582 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
607d6bb819
commit
ff6477b720
@ -21,10 +21,16 @@ def llvm_gcc_c : Tool<
|
||||
"llvm-gcc -E -x c++ $INFILE -o $OUTFILE",
|
||||
(default),
|
||||
"llvm-gcc -E -x c++ $INFILE"),
|
||||
(switch_on "fsyntax-only"),
|
||||
"llvm-gcc -c -x c $INFILE",
|
||||
(default),
|
||||
"llvm-gcc -c -x c $INFILE -o $OUTFILE -emit-llvm")),
|
||||
(switch_option "E", (stop_compilation),
|
||||
(help "Stop after the preprocessing stage, do not run the compiler")),
|
||||
(switch_option "fsyntax-only", (stop_compilation),
|
||||
(help "Stop after checking the input for syntax errors")),
|
||||
(parameter_list_option "include", (forward),
|
||||
(help "Include the named file prior to preprocessing")),
|
||||
(sink)
|
||||
]>;
|
||||
|
||||
|
9
test/LLVMC/include.c
Normal file
9
test/LLVMC/include.c
Normal file
@ -0,0 +1,9 @@
|
||||
/*
|
||||
* Check that the 'include' options work.
|
||||
* RUN: echo "int x;\n" > %t1.inc
|
||||
* RUN: llvmc2 -include %t1.inc -fsyntax-only %s
|
||||
*/
|
||||
|
||||
int f0(void) {
|
||||
return x;
|
||||
}
|
Loading…
Reference in New Issue
Block a user