[NewGVN][NFC] add poison tests

This commit is contained in:
Nuno Lopes 2022-01-30 10:04:00 +00:00
parent 5a2020d069
commit 42a761e57c
1 changed files with 26 additions and 0 deletions

View File

@ -41,3 +41,29 @@ define i8 @simplify_add_poison(i8 %x) {
%r = add i8 poison, %x
ret i8 %r
}
define i8 @simplify_xor_poison(i8 %x) {
; CHECK-LABEL: @simplify_xor_poison(
; CHECK-NEXT: [[R:%.*]] = xor i8 poison, [[X:%.*]]
; CHECK-NEXT: ret i8 [[R]]
;
%r = xor i8 poison, %x
ret i8 %r
}
define i8 @simplify_sdiv_poison(i8 %x) {
; CHECK-LABEL: @simplify_sdiv_poison(
; CHECK-NEXT: ret i8 poison
;
%r = sdiv i8 poison, %x
ret i8 %r
}
define i8 @simplify_urem_poison(i8 %x) {
; CHECK-LABEL: @simplify_urem_poison(
; CHECK-NEXT: [[R:%.*]] = urem i8 [[X:%.*]], poison
; CHECK-NEXT: ret i8 [[R]]
;
%r = urem i8 %x, poison
ret i8 %r
}