mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Teach isKnownNonNull that a nonnull return is not null. Add a test for this case as well as the case of a nonnull attribute (already handled but not tested).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209193 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -866,3 +866,20 @@ define i1 @exact_ashr_sgt_false(i32 %a) {
|
||||
; CHECK-LABEL: @exact_ashr_sgt_false
|
||||
; CHECK-NEXT: ret i1 false
|
||||
}
|
||||
|
||||
define i1 @nonnull_arg(i32* nonnull %i) {
|
||||
%cmp = icmp eq i32* %i, null
|
||||
ret i1 %cmp
|
||||
; CHECK-LABEL: @nonnull_arg
|
||||
; CHECK: ret i1 false
|
||||
}
|
||||
|
||||
declare nonnull i32* @returns_nonnull_helper()
|
||||
define i1 @returns_nonnull() {
|
||||
%call = call nonnull i32* @returns_nonnull_helper()
|
||||
%cmp = icmp eq i32* %call, null
|
||||
ret i1 %cmp
|
||||
; CHECK-LABEL: @returns_nonnull
|
||||
; CHECK: ret i1 false
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user