Skip to content

Commit a991ccd

Browse files
authored
[LTO][CodeGen] Test LTO pipeline choices more thoroughly (llvm#65485)
The test was looking only for the bitcode writer pass; it should check the full pipeline to make sure the choice is as intended.
1 parent 7dd48cc commit a991ccd

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

clang/test/CodeGen/unified-lto-pipeline.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
// RUN: %clang --target=x86_64-unknown-unknown-linux -Xclang -fdebug-pass-manager -flto=thin -funified-lto -O2 -c %s -o %t.0 2>&1 | FileCheck --check-prefix=THIN %s
2-
// RUN: mv %t.0 %t.1
3-
// RUN: %clang --target=x86_64-unknown-unknown-linux -Xclang -fdebug-pass-manager -flto=full -funified-lto -O2 -c %s -o %t.0 2>&1 | FileCheck --check-prefix=THIN %s
4-
// RUN: %clang --target=x86_64-unknown-unknown-linux -Xclang -fdebug-pass-manager -flto=thin -O2 -c %s -o %t.2 2>&1 | FileCheck --check-prefix=THIN %s
5-
// RUN: mv %t.2 %t.3
6-
// RUN: %clang --target=x86_64-unknown-unknown-linux -Xclang -fdebug-pass-manager -flto=full -O2 -c %s -o %t.2 2>&1 | FileCheck --check-prefix=FULL %s
7-
// RUN: cmp %t.0 %t.1
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
87
// THIN: ThinLTOBitcodeWriterPass
98
// 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
1016

1117
int foo() {
1218
return 2 + 2;

0 commit comments

Comments
 (0)