2014-06-27 10:04:28 +08:00
|
|
|
// Test that we can consume LLVM IR/bitcode in the frontend and produce
|
2014-06-27 10:59:39 +08:00
|
|
|
// equivalent output to a standard compilation.
|
2014-06-27 10:04:28 +08:00
|
|
|
|
2014-06-27 10:59:39 +08:00
|
|
|
// We strip differing '.file' directives before comparing.
|
2014-06-27 10:35:57 +08:00
|
|
|
|
2014-06-27 10:04:28 +08:00
|
|
|
// Reference output:
|
2014-06-27 11:11:38 +08:00
|
|
|
// RUN: %clang_cc1 -S -o - %s | grep -v '\.file' > %t.s
|
2014-06-27 10:04:28 +08:00
|
|
|
|
|
|
|
// LLVM bitcode:
|
|
|
|
// RUN: %clang_cc1 -emit-llvm-bc -o %t.bc %s
|
2014-06-27 11:11:38 +08:00
|
|
|
// RUN: %clang_cc1 -S -o - %t.bc | grep -v '\.file' > %t.bc.s
|
2014-06-27 10:59:39 +08:00
|
|
|
// RUN: diff %t.s %t.bc.s
|
2014-06-27 10:04:28 +08:00
|
|
|
|
|
|
|
// LLVM IR source code:
|
2014-06-27 10:59:39 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -o %t.ll %s
|
2014-06-27 11:11:38 +08:00
|
|
|
// RUN: %clang_cc1 -S -o - %t.ll | grep -v '\.file' > %t.ll.s
|
2014-06-27 10:59:39 +08:00
|
|
|
// RUN: diff %t.s %t.ll.s
|
2014-06-27 10:04:28 +08:00
|
|
|
|
|
|
|
int f() { return 0; }
|