Skip to content

Commit 111844a

Browse files
authored
[LTO] Enhance unified/nonunified LTO checks. (llvm#148229)
For the PS targets, unified LTO pipeline is used as default behaviour when enabling LTO. Other targets use Distinct LTO pipeline behaviour as default behavious. Unified/nonunified LTO checks are enhanced in this PR: 1. Check that the default, unified, and non-unified behavior for asan-unified-lto.ll all match (irrespective of what the default unified/nonunified behavior is). 2. Check that the difference in behavior for 'unified' and 'full' runs is (regarding the passes) is what is expected (rather than simply that they are different).
1 parent 11c19ea commit 111844a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

clang/test/CodeGen/asan-unified-lto.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
; RUN: %clang_cc1 -emit-llvm-bc -O1 -flto -fsanitize=address -o - -x ir < %s | llvm-dis -o - | FileCheck %s
77
; RUN: %clang_cc1 -emit-llvm-bc -O1 -flto -funified-lto -fsanitize=address -o - -x ir < %s | llvm-dis -o - | FileCheck %s
8+
; RUN: %clang_cc1 -emit-llvm-bc -O1 -flto -fno-unified-lto -fsanitize=address -o - -x ir < %s | llvm-dis -o - | FileCheck %s
89
; CHECK: @anon.3ee0898e5200a57350fed5485ae5d237
910

1011
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
/// Check that pass pipelines for thin, thin-unified, full-unified all match.
1212
// RUN: diff %t.0.txt %t.1.txt
1313
// 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
14+
/// 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: ThinLTOBitcodeWriterPass
17+
// DIFF-NEXT: +Running pass: BitcodeWriterPass
1618

1719
int foo() {
1820
return 2 + 2;

0 commit comments

Comments
 (0)