summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-06-27 02:04:28 +0000
committerAlp Toker <alp@nuanti.com>2014-06-27 02:04:28 +0000
commit71a62fbfeaef46dc5cd7030e61a5b2014fbb6cb6 (patch)
tree3bbc2a3a0291663586252e3cc9e13741d255e88a
parent685fae4af528a9d0c92d655daab47dcce6364982 (diff)
downloadclang-71a62fbfeaef46dc5cd7030e61a5b2014fbb6cb6.tar.gz
clang-71a62fbfeaef46dc5cd7030e61a5b2014fbb6cb6.tar.bz2
clang-71a62fbfeaef46dc5cd7030e61a5b2014fbb6cb6.tar.xz
Add test coverage for .bc input in the frontend
Test that we can consume LLVM bitcode and additionally check that it produces the same output as a direct compilation. The feature is crashy and has gone untested until now, but we might as well provide some coverage as long as it remains in tree. Also test LL source input in the same way because the existing tests for that don't look convincing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211844 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Frontend/ir-support.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Frontend/ir-support.c b/test/Frontend/ir-support.c
new file mode 100644
index 0000000000..3e1089b965
--- /dev/null
+++ b/test/Frontend/ir-support.c
@@ -0,0 +1,17 @@
+// Test that we can consume LLVM IR/bitcode in the frontend and produce
+// identical output to a standard compilation.
+
+// Reference output:
+// RUN: %clang_cc1 -S -o %t.s %s
+
+// LLVM bitcode:
+// RUN: %clang_cc1 -emit-llvm-bc -o %t.bc %s
+// RUN: %clang_cc1 -S -o - %t.bc > %t.bc.s
+// RUN: diff %t.s %t.bc.s
+
+// LLVM IR source code:
+// RUN: %clang_cc1 -emit-llvm-bc -o %t.ll %s
+// RUN: %clang_cc1 -S -o - %t.ll > %t.ll.s
+// RUN: diff %t.s %t.ll.s
+
+int f() { return 0; }