@@ -22,3 +22,39 @@ define i1 @bad_icmp_constexpr_bitcast() {
22
22
%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 )
23
23
ret i1 %cmp
24
24
}
25
+
26
+ ; FIXME: If the bitcasts result in a NaN FP value, then "ordered and equal" would be false.
27
+
28
+ define i1 @fcmp_constexpr_oeq (float %conv ) {
29
+ ; CHECK-LABEL: @fcmp_constexpr_oeq(
30
+ ; CHECK-NEXT: ret i1 true
31
+ ;
32
+ %cmp = fcmp oeq float bitcast (i32 ptrtoint (i16* @a to i32 ) to float ), bitcast (i32 ptrtoint (i16* @a to i32 ) to float )
33
+ ret i1 %cmp
34
+ }
35
+
36
+ ; FIXME: If the bitcasts result in a NaN FP value, then "unordered or not equal" would be true.
37
+
38
+ define i1 @fcmp_constexpr_une (float %conv ) {
39
+ ; CHECK-LABEL: @fcmp_constexpr_une(
40
+ ; CHECK-NEXT: ret i1 false
41
+ ;
42
+ %cmp = fcmp une float bitcast (i32 ptrtoint (i16* @a to i32 ) to float ), bitcast (i32 ptrtoint (i16* @a to i32 ) to float )
43
+ ret i1 %cmp
44
+ }
45
+
46
+ define i1 @fcmp_constexpr_ueq (float %conv ) {
47
+ ; CHECK-LABEL: @fcmp_constexpr_ueq(
48
+ ; CHECK-NEXT: ret i1 true
49
+ ;
50
+ %cmp = fcmp ueq float bitcast (i32 ptrtoint (i16* @a to i32 ) to float ), bitcast (i32 ptrtoint (i16* @a to i32 ) to float )
51
+ ret i1 %cmp
52
+ }
53
+
54
+ define i1 @fcmp_constexpr_one (float %conv ) {
55
+ ; CHECK-LABEL: @fcmp_constexpr_one(
56
+ ; CHECK-NEXT: ret i1 false
57
+ ;
58
+ %cmp = fcmp one float bitcast (i32 ptrtoint (i16* @a to i32 ) to float ), bitcast (i32 ptrtoint (i16* @a to i32 ) to float )
59
+ ret i1 %cmp
60
+ }
0 commit comments