-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option -verify-cfiinstrs to run verifier in CFIInstrInserter
Instead of enabling it for non NDEBUG builds, use -verify-cfiinstrs to run verifier in CFIInstrInserter. It defaults to false. Differential Revision: https://reviews.llvm.org/D46444 llvm-svn: 331635
- Loading branch information
1 parent
1c451db
commit cc49157
Showing
3 changed files
with
63 additions
and
5 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
26 changes: 26 additions & 0 deletions
26
llvm/test/CodeGen/X86/cfi-inserter-verify-inconsistent-offset.mir
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,26 @@ | ||
# RUN: not llc -o - %s -mtriple=x86_64-- -verify-cfiinstrs \ | ||
# RUN: -run-pass=cfi-instr-inserter 2>&1 | FileCheck %s | ||
# Test that CFI verifier finds inconsistent offset between bb.end and one of | ||
# its precedessors. | ||
--- | | ||
define void @inconsistentOffset() { | ||
bb.end: | ||
ret void | ||
} | ||
... | ||
--- | ||
# CHECK: *** Inconsistent CFA register and/or offset between pred and succ *** | ||
# CHECK: Succ: bb.end | ||
# CHECK: LLVM ERROR: Found 1 in/out CFI information errors. | ||
name: inconsistentOffset | ||
body: | | ||
bb.0: | ||
CFI_INSTRUCTION def_cfa_offset 24 | ||
JNE_1 %bb.2, implicit undef $eflags | ||
bb.1: | ||
CFI_INSTRUCTION def_cfa_offset 32 | ||
bb.2.bb.end: | ||
RET 0 | ||
... |
26 changes: 26 additions & 0 deletions
26
llvm/test/CodeGen/X86/cfi-inserter-verify-inconsistent-register.mir
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,26 @@ | ||
# RUN: not llc -o - %s -mtriple=x86_64-- -verify-cfiinstrs \ | ||
# RUN: -run-pass=cfi-instr-inserter 2>&1 | FileCheck %s | ||
# Test that CFI verifier finds inconsistent register between bb.end and one of | ||
# its precedessors. | ||
--- | | ||
define void @inconsistentRegister() { | ||
bb.end: | ||
ret void | ||
} | ||
... | ||
--- | ||
# CHECK: *** Inconsistent CFA register and/or offset between pred and succ *** | ||
# CHECK: Succ: bb.end | ||
# CHECK: LLVM ERROR: Found 1 in/out CFI information errors. | ||
name: inconsistentRegister | ||
body: | | ||
bb.0: | ||
CFI_INSTRUCTION def_cfa_register $rbp | ||
JNE_1 %bb.2, implicit undef $eflags | ||
bb.1: | ||
CFI_INSTRUCTION def_cfa $rsp, 8 | ||
bb.2.bb.end: | ||
RET 0 | ||
... |