[llvm] a9d4a7a - [Float2Int] Add test for PR54669 (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 1 03:27:46 PDT 2022


Author: Nikita Popov
Date: 2022-04-01T12:27:37+02:00
New Revision: a9d4a7ad80e5f948eb073e1df0f1ca8a304d225f

URL: https://github.com/llvm/llvm-project/commit/a9d4a7ad80e5f948eb073e1df0f1ca8a304d225f
DIFF: https://github.com/llvm/llvm-project/commit/a9d4a7ad80e5f948eb073e1df0f1ca8a304d225f.diff

LOG: [Float2Int] Add test for PR54669 (NFC)

Added: 
    llvm/test/Transforms/Float2Int/pr54669.ll

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/Float2Int/pr54669.ll b/llvm/test/Transforms/Float2Int/pr54669.ll
new file mode 100644
index 0000000000000..135bee55fe260
--- /dev/null
+++ b/llvm/test/Transforms/Float2Int/pr54669.ll
@@ -0,0 +1,19 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -S -float2int < %s | FileCheck %s
+
+declare void @use(i32)
+
+; FIXME: Currently being miscompiled.
+
+define i1 @src() {
+; CHECK-LABEL: @src(
+; CHECK-NEXT:    [[CMP:%.*]] = icmp eq i32 2147483647, -1
+; CHECK-NEXT:    ret i1 [[CMP]]
+;
+  %add = fadd double 2.000000e+00, -1.000000e+00
+  %mul = fmul double %add, 0x41EFFFFFFFE00000
+  %conv = fptoui double %mul to i32
+  %cmp = icmp eq i32 %conv, -1
+  %conv2 = fptoui double %add to i32
+  ret i1 %cmp
+}


        


More information about the llvm-commits mailing list