xref: /aosp_15_r20/external/clang/test/Frontend/ir-support.c (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // Test that we can consume LLVM IR/bitcode in the frontend and produce
2*67e74705SXin Li // equivalent output to a standard compilation.
3*67e74705SXin Li 
4*67e74705SXin Li // We strip differing '.file' directives before comparing.
5*67e74705SXin Li 
6*67e74705SXin Li // Reference output:
7*67e74705SXin Li // RUN: %clang_cc1 -S -o - %s | grep -v '\.file' > %t.s
8*67e74705SXin Li 
9*67e74705SXin Li // LLVM bitcode:
10*67e74705SXin Li // RUN: %clang_cc1 -emit-llvm-bc -o %t.bc %s
11*67e74705SXin Li // RUN: %clang_cc1 -S -o - %t.bc | grep -v '\.file' > %t.bc.s
12*67e74705SXin Li // RUN: diff %t.s %t.bc.s
13*67e74705SXin Li 
14*67e74705SXin Li // LLVM IR source code:
15*67e74705SXin Li // RUN: %clang_cc1 -emit-llvm -o %t.ll %s
16*67e74705SXin Li // RUN: %clang_cc1 -S -o - %t.ll | grep -v '\.file' > %t.ll.s
17*67e74705SXin Li // RUN: diff %t.s %t.ll.s
18*67e74705SXin Li 
f()19*67e74705SXin Li int f() { return 0; }
20