Skip to content

Commit 2f6dc0a

Browse files
committed
Address review comments
- Use `CheckFailed` instead of `report_fatal_error` in verifier - Add tests for verifier
1 parent ab89fdc commit 2f6dc0a

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

llvm/lib/IR/Verifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1754,7 +1754,7 @@ void Verifier::visitModuleFlags() {
17541754
}
17551755

17561756
if ((PAuthABIPlatform == uint64_t(-1)) != (PAuthABIVersion == uint64_t(-1)))
1757-
report_fatal_error(
1757+
CheckFailed(
17581758
"either both or no 'aarch64-elf-pauthabi-platform' and "
17591759
"'aarch64-elf-pauthabi-version' module flags must be present");
17601760

llvm/test/CodeGen/AArch64/note-gnu-property-elf-pauthabi.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
;--- err1.ll
3535

36-
; RUN: not --crash llc -mtriple=aarch64-linux err1.ll 2>&1 -o - | \
36+
; RUN: not llc -mtriple=aarch64-linux err1.ll 2>&1 -o - | \
3737
; RUN: FileCheck %s --check-prefix=ERR
3838

3939
!llvm.module.flags = !{!0}
@@ -42,7 +42,7 @@
4242

4343
;--- err2.ll
4444

45-
; RUN: not --crash llc -mtriple=aarch64-linux err2.ll 2>&1 -o - | \
45+
; RUN: not llc -mtriple=aarch64-linux err2.ll 2>&1 -o - | \
4646
; RUN: FileCheck %s --check-prefix=ERR
4747

4848
!llvm.module.flags = !{!0}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
; RUN: rm -rf %t && split-file %s %t && cd %t
2+
3+
; CHECK: either both or no 'aarch64-elf-pauthabi-platform' and 'aarch64-elf-pauthabi-version' module flags must be present
4+
5+
;--- err1.ll
6+
7+
; RUN: not llvm-as err1.ll -o /dev/null 2>&1 | FileCheck %s
8+
9+
!llvm.module.flags = !{!0}
10+
11+
!0 = !{i32 1, !"aarch64-elf-pauthabi-platform", i32 2}
12+
13+
;--- err2.ll
14+
15+
; RUN: not llvm-as err2.ll -o /dev/null 2>&1 | FileCheck %s
16+
17+
!llvm.module.flags = !{!0}
18+
19+
!0 = !{i32 1, !"aarch64-elf-pauthabi-version", i32 31}

0 commit comments

Comments
 (0)