Skip to content

Commit

Permalink
[CGP] Add additional tests for ARM
Browse files Browse the repository at this point in the history
  • Loading branch information
dtcxzyw committed Apr 29, 2024
1 parent 7e7bf0b commit e2130c4
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions llvm/test/Transforms/CodeGenPrepare/ARM/branch-on-zero.ll
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,29 @@ else:
ret i32 %l
}

define i32 @sub10_else_drop_nuw(i32 %a) {
; CHECK-LABEL: @sub10_else_drop_nuw(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[L:%.*]] = sub i32 [[A:%.*]], 10
; CHECK-NEXT: [[TMP0:%.*]] = icmp eq i32 [[L]], 0
; CHECK-NEXT: br i1 [[TMP0]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
; CHECK-NEXT: ret i32 0
; CHECK: else:
; CHECK-NEXT: ret i32 [[L]]
;
entry:
%c = icmp eq i32 %a, 10
br i1 %c, label %then, label %else

then:
ret i32 0

else:
%l = sub nuw i32 %a, 10
ret i32 %l
}

define i32 @subm10_then(i32 %a) {
; CHECK-LABEL: @subm10_then(
; CHECK-NEXT: entry:
Expand Down

0 comments on commit e2130c4

Please sign in to comment.