diff options
-rw-r--r-- | include/llvm/CompilerDriver/Tools.td | 2 | ||||
-rw-r--r-- | test/LLVMC/emit-llvm.c | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/CompilerDriver/Tools.td b/include/llvm/CompilerDriver/Tools.td index 4ff1a52822..fa2cd33ffb 100644 --- a/include/llvm/CompilerDriver/Tools.td +++ b/include/llvm/CompilerDriver/Tools.td @@ -25,6 +25,8 @@ def llvm_gcc_c : Tool< "llvm-gcc -c -x c $INFILE", (default), "llvm-gcc -c -x c $INFILE -o $OUTFILE -emit-llvm")), + (switch_option "emit-llvm", (stop_compilation), + (help "Emit LLVM intermediate files instead of native object files")), (switch_option "E", (stop_compilation), (help "Stop after the preprocessing stage, do not run the compiler")), (switch_option "fsyntax-only", (stop_compilation), diff --git a/test/LLVMC/emit-llvm.c b/test/LLVMC/emit-llvm.c new file mode 100644 index 0000000000..5a6aa0f538 --- /dev/null +++ b/test/LLVMC/emit-llvm.c @@ -0,0 +1,4 @@ +// RUN: llvmc2 -c -emit-llvm -o - %s | llvm-dis | grep "@f0()" | count 1 + +int f0(void) { +} |