summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/ConstProp/bitcast.ll
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2019-02-13 23:27:31 +0000
committerSanjay Patel <spatel@rotateright.com>2019-02-13 23:27:31 +0000
commitd05ba496bc559bfe1c986bb31d59645143de9405 (patch)
tree9bbae6c4f41148d4acae9176227dce7382cb1a34 /llvm/test/Transforms/ConstProp/bitcast.ll
parent91ab9bf32cc5d20919bcc1989bde3eca1a3c1764 (diff)
downloadbcm5719-llvm-d05ba496bc559bfe1c986bb31d59645143de9405.tar.gz
bcm5719-llvm-d05ba496bc559bfe1c986bb31d59645143de9405.zip
[ConstProp] add IR tests to show miscompiles; NFC
A fix for these is proposed in D51216. llvm-svn: 353992
Diffstat (limited to 'llvm/test/Transforms/ConstProp/bitcast.ll')
-rw-r--r--llvm/test/Transforms/ConstProp/bitcast.ll36
1 files changed, 36 insertions, 0 deletions
diff --git a/llvm/test/Transforms/ConstProp/bitcast.ll b/llvm/test/Transforms/ConstProp/bitcast.ll
index 353062ee3fe..f914702f3ad 100644
--- a/llvm/test/Transforms/ConstProp/bitcast.ll
+++ b/llvm/test/Transforms/ConstProp/bitcast.ll
@@ -22,3 +22,39 @@ define i1 @bad_icmp_constexpr_bitcast() {
%cmp = icmp eq i32 ptrtoint (i16* @a to i32), bitcast (float fadd (float bitcast (i32 ptrtoint (i16* @b to i32) to float), float 2.0) to i32)
ret i1 %cmp
}
+
+; FIXME: If the bitcasts result in a NaN FP value, then "ordered and equal" would be false.
+
+define i1 @fcmp_constexpr_oeq(float %conv) {
+; CHECK-LABEL: @fcmp_constexpr_oeq(
+; CHECK-NEXT: ret i1 true
+;
+ %cmp = fcmp oeq float bitcast (i32 ptrtoint (i16* @a to i32) to float), bitcast (i32 ptrtoint (i16* @a to i32) to float)
+ ret i1 %cmp
+}
+
+; FIXME: If the bitcasts result in a NaN FP value, then "unordered or not equal" would be true.
+
+define i1 @fcmp_constexpr_une(float %conv) {
+; CHECK-LABEL: @fcmp_constexpr_une(
+; CHECK-NEXT: ret i1 false
+;
+ %cmp = fcmp une float bitcast (i32 ptrtoint (i16* @a to i32) to float), bitcast (i32 ptrtoint (i16* @a to i32) to float)
+ ret i1 %cmp
+}
+
+define i1 @fcmp_constexpr_ueq(float %conv) {
+; CHECK-LABEL: @fcmp_constexpr_ueq(
+; CHECK-NEXT: ret i1 true
+;
+ %cmp = fcmp ueq float bitcast (i32 ptrtoint (i16* @a to i32) to float), bitcast (i32 ptrtoint (i16* @a to i32) to float)
+ ret i1 %cmp
+}
+
+define i1 @fcmp_constexpr_one(float %conv) {
+; CHECK-LABEL: @fcmp_constexpr_one(
+; CHECK-NEXT: ret i1 false
+;
+ %cmp = fcmp one float bitcast (i32 ptrtoint (i16* @a to i32) to float), bitcast (i32 ptrtoint (i16* @a to i32) to float)
+ ret i1 %cmp
+}
OpenPOWER on IntegriCloud