From 1a5a520d9555680898b6112bf6a601ceb85c300d Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Fri, 27 Jun 2014 02:04:28 +0000 Subject: [PATCH] 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. llvm-svn: 211844 --- clang/test/Frontend/ir-support.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 clang/test/Frontend/ir-support.c diff --git a/clang/test/Frontend/ir-support.c b/clang/test/Frontend/ir-support.c new file mode 100644 index 0000000..3e1089b --- /dev/null +++ b/clang/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; } -- 2.7.4