26 lines · c
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.txt2// 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.txt3// RUN: %clang --target=x86_64-unknown-unknown-linux -Xclang -fdebug-pass-manager -flto=thin -O2 -c %s -o %t.2 2>%t.2.txt4// RUN: %clang --target=x86_64-unknown-unknown-linux -Xclang -fdebug-pass-manager -flto=full -O2 -c %s -o %t.3 2>%t.3.txt5// RUN: FileCheck --input-file %t.0.txt %s --check-prefix=THIN6// RUN: FileCheck --input-file %t.3.txt %s --check-prefix=FULL7// THIN: ThinLTOBitcodeWriterPass8// FULL-NOT: ThinLTOBitcodeWriterPass9/// Check that thin/full unified bitcode matches.10// RUN: cmp %t.0 %t.111/// Check that pass pipelines for thin, thin-unified, full-unified all match.12// RUN: diff %t.0.txt %t.1.txt13// RUN: diff %t.0.txt %t.2.txt14/// Pass pipeline for full is different. Unified uses the full Linux pipeline except ThinLTOBitcodeWriterPass vs BitcodeWriterPass.15// RUN: not diff -u %t.0.txt %t.3.txt | FileCheck %s --check-prefix=DIFF --implicit-check-not="{{^[-+!<>] }}"16// DIFF: -Running pass: ThinLTOBitcodeWriterPass17// DIFF-NEXT: +Running pass: BitcodeWriterPass18 19int foo() {20 return 2 + 2;21}22 23int bar() {24 return foo() + 1;25}26