-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Verifier] Check that !nonnull metadata is empty
!nonnull expectes an empty metadata argument, so check that this is the case in the verifier. This came up as a problem in https://reviews.llvm.org/D141386. This requires dropping the verifier call in the compatibility-6.0.ll test (which is not present in any of the other bitcode compatibility tests). The original input unfortunately used typo'd nonnull metadata.
- Loading branch information
Showing
3 changed files
with
23 additions
and
2 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
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,21 @@ | ||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s | ||
|
||
declare ptr @dummy() | ||
|
||
; CHECK: nonnull applies only to pointer types | ||
define void @test_not_pointer(ptr %p) { | ||
load i32, ptr %p, !nonnull !{} | ||
ret void | ||
} | ||
|
||
; CHECK: nonnull applies only to load instructions, use attributes for calls or invokes | ||
define void @test_not_load() { | ||
call ptr @dummy(), !nonnull !{} | ||
ret void | ||
} | ||
|
||
; CHECK: nonnull metadata must be empty | ||
define void @test_invalid_arg(ptr %p) { | ||
load ptr, ptr %p, !nonnull !{i32 0} | ||
ret void | ||
} |