[InstCombine] add tests to show missing one-use checks; NFC
diff --git a/llvm/test/Transforms/InstCombine/select-bitext.ll b/llvm/test/Transforms/InstCombine/select-bitext.ll
index d44be27..d39dca9 100644
--- a/llvm/test/Transforms/InstCombine/select-bitext.ll
+++ b/llvm/test/Transforms/InstCombine/select-bitext.ll
@@ -1,6 +1,8 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
 ; RUN: opt < %s -instcombine -S | FileCheck %s
 
+declare void @use32(i32)
+
 ; Widen a select of constants to eliminate an extend.
 
 define i16 @sel_sext_constants(i1 %cmp) {
@@ -451,6 +453,38 @@
   ret i32 %r
 }
 
+define i32 @sel_sext_const_uses(i8 %a, i8 %x) {
+; CHECK-LABEL: @sel_sext_const_uses(
+; CHECK-NEXT:    [[COND:%.*]] = icmp ugt i8 [[X:%.*]], 15
+; CHECK-NEXT:    [[A_EXT:%.*]] = sext i8 [[A:%.*]] to i32
+; CHECK-NEXT:    call void @use32(i32 [[A_EXT]])
+; CHECK-NEXT:    [[NARROW:%.*]] = select i1 [[COND]], i8 [[A]], i8 127
+; CHECK-NEXT:    [[R:%.*]] = sext i8 [[NARROW]] to i32
+; CHECK-NEXT:    ret i32 [[R]]
+;
+  %cond = icmp ugt i8 %x, 15
+  %a.ext = sext i8 %a to i32
+  call void @use32(i32 %a.ext)
+  %r = select i1 %cond, i32 %a.ext, i32 127
+  ret i32 %r
+}
+
+define i32 @sel_zext_const_uses(i8 %a, i8 %x) {
+; CHECK-LABEL: @sel_zext_const_uses(
+; CHECK-NEXT:    [[COND:%.*]] = icmp sgt i8 [[X:%.*]], 15
+; CHECK-NEXT:    [[A_EXT:%.*]] = zext i8 [[A:%.*]] to i32
+; CHECK-NEXT:    call void @use32(i32 [[A_EXT]])
+; CHECK-NEXT:    [[NARROW:%.*]] = select i1 [[COND]], i8 -1, i8 [[A]]
+; CHECK-NEXT:    [[R:%.*]] = zext i8 [[NARROW]] to i32
+; CHECK-NEXT:    ret i32 [[R]]
+;
+  %cond = icmp sgt i8 %x, 15
+  %a.ext = zext i8 %a to i32
+  call void @use32(i32 %a.ext)
+  %r = select i1 %cond, i32 255, i32 %a.ext
+  ret i32 %r
+}
+
 define i32 @test_op_op(i32 %a, i32 %b, i32 %c) {
 ; CHECK-LABEL: @test_op_op(
 ; CHECK-NEXT:    [[CCA:%.*]] = icmp sgt i32 [[A:%.*]], 0