-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Lint] Add option --lint-abort-on-error (#81999)
This option makes the lint pass abort if errors were found. This is intended to help lit testing where the lint pass is used and lint errors should be detected. Previously, this required checking for non-empty stderr.
- Loading branch information
1 parent
283a6b9
commit 756ff96
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
; RUN: not opt -passes=lint -disable-output --lint-abort-on-error %s 2>&1 | FileCheck %s | ||
|
||
; CHECK: Undefined behavior: Division by zero | ||
; CHECK-NEXT: %b = sdiv i32 %a, 0 | ||
; CHECK-NEXT: LLVM ERROR: Linter found errors, aborting. (enabled by --lint-abort-on-error) | ||
|
||
define i32 @sdiv_by_zero(i32 %a) { | ||
%b = sdiv i32 %a, 0 | ||
ret i32 %b | ||
} |