[flang] Fix crash in HLFIR generation (#118399)
[llvm-project.git] / clang / test / CodeGen / unified-lto-pipeline.c
blobe13cd57eed67d204c16f3ccfe4acdc0a4b6f16b5
1 // RUN: %clang --target=x86_64-unknown-unknown-linux -Xclang -fdebug-pass-manager -flto=thin -funified-lto -O2 -c %s -o %t.0 2>%t.0.txt
2 // RUN: %clang --target=x86_64-unknown-unknown-linux -Xclang -fdebug-pass-manager -flto=full -funified-lto -O2 -c %s -o %t.1 2>%t.1.txt
3 // RUN: %clang --target=x86_64-unknown-unknown-linux -Xclang -fdebug-pass-manager -flto=thin -O2 -c %s -o %t.2 2>%t.2.txt
4 // RUN: %clang --target=x86_64-unknown-unknown-linux -Xclang -fdebug-pass-manager -flto=full -O2 -c %s -o %t.3 2>%t.3.txt
5 // RUN: FileCheck --input-file %t.0.txt %s --check-prefix=THIN
6 // RUN: FileCheck --input-file %t.3.txt %s --check-prefix=FULL
7 // THIN: ThinLTOBitcodeWriterPass
8 // FULL-NOT: ThinLTOBitcodeWriterPass
9 /// Check that thin/full unified bitcode matches.
10 // RUN: cmp %t.0 %t.1
11 /// Check that pass pipelines for thin, thin-unified, full-unified all match.
12 // RUN: diff %t.0.txt %t.1.txt
13 // RUN: diff %t.0.txt %t.2.txt
14 /// Pass pipeline for full is different.
15 // RUN: not diff %t.0.txt %t.3.txt
17 int foo() {
18 return 2 + 2;
21 int bar() {
22 return foo() + 1;