[ConstraintElim] Add test for #68751 (NFC)
authorNikita Popov <npopov@redhat.com>
Wed, 11 Oct 2023 13:52:18 +0000 (15:52 +0200)
committerTobias Hieta <tobias@hieta.se>
Tue, 24 Oct 2023 06:29:57 +0000 (08:29 +0200)
(cherry picked from commit 2b74db6c9bff757ce016d62a7086617e2b9e43b3)

llvm/test/Transforms/ConstraintElimination/large-constant-ints.ll

index f080684..91ab42e 100644 (file)
@@ -423,4 +423,17 @@ entry:
   ret i1 %res
 }
 
+; FIXME: This is a miscompile.
+define i1 @pr68751(i128 %arg) {
+; CHECK-LABEL: @pr68751(
+; CHECK-NEXT:    [[SHL1:%.*]] = shl nuw nsw i128 [[ARG:%.*]], 32
+; CHECK-NEXT:    [[SHL2:%.*]] = shl nuw nsw i128 [[SHL1]], 32
+; CHECK-NEXT:    ret i1 true
+;
+  %shl1 = shl nuw nsw i128 %arg, 32
+  %shl2 = shl nuw nsw i128 %shl1, 32
+  %cmp = icmp eq i128 %shl2, 0
+  ret i1 %cmp
+}
+
 declare void @llvm.assume(i1)