LLVMC2: -emit-llvm stops compilation.
authorDaniel Dunbar <daniel@zuster.org>
Wed, 19 Nov 2008 04:15:56 +0000 (04:15 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 19 Nov 2008 04:15:56 +0000 (04:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59586 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CompilerDriver/Tools.td
test/LLVMC/emit-llvm.c [new file with mode: 0644]

index 4ff1a52822f8dec2fe0b90a5d7f11e2da18818bf..fa2cd33ffbdde88033b35f48a90e2f813e29e60d 100644 (file)
@@ -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 (file)
index 0000000..5a6aa0f
--- /dev/null
@@ -0,0 +1,4 @@
+// RUN: llvmc2 -c -emit-llvm -o - %s | llvm-dis | grep "@f0()" | count 1
+
+int f0(void) {
+}