r211844 - Add test coverage for .bc input in the frontend
Alp Toker
alp at nuanti.com
Thu Jun 26 19:04:28 PDT 2014
Author: alp
Date: Thu Jun 26 21:04:28 2014
New Revision: 211844
URL: http://llvm.org/viewvc/llvm-project?rev=211844&view=rev
Log:
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.
Added:
cfe/trunk/test/Frontend/ir-support.c
Added: cfe/trunk/test/Frontend/ir-support.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/ir-support.c?rev=211844&view=auto
==============================================================================
--- cfe/trunk/test/Frontend/ir-support.c (added)
+++ cfe/trunk/test/Frontend/ir-support.c Thu Jun 26 21:04:28 2014
@@ -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; }
More information about the cfe-commits
mailing list