blob: f69161e8705cd5ae6a712a7a70955c18e450faf4 [file] [log] [blame]
Alp Toker1a5a5202014-06-27 02:04:28 +00001// Test that we can consume LLVM IR/bitcode in the frontend and produce
Alp Toker830c34e2014-06-27 02:59:39 +00002// equivalent output to a standard compilation.
Alp Toker1a5a5202014-06-27 02:04:28 +00003
Alp Toker830c34e2014-06-27 02:59:39 +00004// We strip differing '.file' directives before comparing.
Alp Toker8e7e1b82014-06-27 02:35:57 +00005
Alp Toker1a5a5202014-06-27 02:04:28 +00006// Reference output:
Alp Toker1d1ac112014-06-27 03:11:38 +00007// RUN: %clang_cc1 -S -o - %s | grep -v '\.file' > %t.s
Alp Toker1a5a5202014-06-27 02:04:28 +00008
9// LLVM bitcode:
10// RUN: %clang_cc1 -emit-llvm-bc -o %t.bc %s
Alp Toker1d1ac112014-06-27 03:11:38 +000011// RUN: %clang_cc1 -S -o - %t.bc | grep -v '\.file' > %t.bc.s
Alp Toker830c34e2014-06-27 02:59:39 +000012// RUN: diff %t.s %t.bc.s
Alp Toker1a5a5202014-06-27 02:04:28 +000013
14// LLVM IR source code:
Alp Toker830c34e2014-06-27 02:59:39 +000015// RUN: %clang_cc1 -emit-llvm -o %t.ll %s
Alp Toker1d1ac112014-06-27 03:11:38 +000016// RUN: %clang_cc1 -S -o - %t.ll | grep -v '\.file' > %t.ll.s
Alp Toker830c34e2014-06-27 02:59:39 +000017// RUN: diff %t.s %t.ll.s
Alp Toker1a5a5202014-06-27 02:04:28 +000018
19int f() { return 0; }