1; RUN: llc < %s -mtriple=arm-apple-darwin | FileCheck %s
2
3; PR30660 - https://llvm.org/bugs/show_bug.cgi?id=30660
4
5define i32 @select_i32_neg1_or_0(i1 %a) {
6; CHECK-LABEL: select_i32_neg1_or_0:
7; CHECK-NEXT:  @ %bb.0:
8; CHECK-NEXT:    and r0, r0, #1
9; CHECK-NEXT:    rsb r0, r0, #0
10; CHECK-NEXT:    mov pc, lr
11;
12  %b = sext i1 %a to i32
13  ret i32 %b
14}
15
16define i32 @select_i32_neg1_or_0_zeroext(i1 zeroext %a) {
17; CHECK-LABEL: select_i32_neg1_or_0_zeroext:
18; CHECK-NEXT:  @ %bb.0:
19; CHECK-NEXT:    rsb r0, r0, #0
20; CHECK-NEXT:    mov pc, lr
21;
22  %b = sext i1 %a to i32
23  ret i32 %b
24}
25
26