1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -constprop -S | FileCheck %s
5 define <1 x i64> @test1() {
7 ; CHECK-NEXT: ret <1 x i64> <i64 63>
9 %A = bitcast i64 63 to <1 x i64>
13 ; FIXME: Don't try to propagate an FP source operand to an icmp.
15 @a = external global i16, align 1
16 @b = external global i16, align 1
18 define i1 @bad_icmp_constexpr_bitcast() {
19 ; CHECK-LABEL: @bad_icmp_constexpr_bitcast(
20 ; CHECK-NEXT: ret i1 icmp eq (float bitcast (i32 ptrtoint (i16* @a to i32) to float), float fadd (float bitcast (i32 ptrtoint (i16* @b to i32) to float), float 2.000000e+00))
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)
26 ; FIXME: If the bitcasts result in a NaN FP value, then "ordered and equal" would be false.
28 define i1 @fcmp_constexpr_oeq(float %conv) {
29 ; CHECK-LABEL: @fcmp_constexpr_oeq(
30 ; CHECK-NEXT: ret i1 true
32 %cmp = fcmp oeq float bitcast (i32 ptrtoint (i16* @a to i32) to float), bitcast (i32 ptrtoint (i16* @a to i32) to float)
36 ; FIXME: If the bitcasts result in a NaN FP value, then "unordered or not equal" would be true.
38 define i1 @fcmp_constexpr_une(float %conv) {
39 ; CHECK-LABEL: @fcmp_constexpr_une(
40 ; CHECK-NEXT: ret i1 false
42 %cmp = fcmp une float bitcast (i32 ptrtoint (i16* @a to i32) to float), bitcast (i32 ptrtoint (i16* @a to i32) to float)
46 define i1 @fcmp_constexpr_ueq(float %conv) {
47 ; CHECK-LABEL: @fcmp_constexpr_ueq(
48 ; CHECK-NEXT: ret i1 true
50 %cmp = fcmp ueq float bitcast (i32 ptrtoint (i16* @a to i32) to float), bitcast (i32 ptrtoint (i16* @a to i32) to float)
54 define i1 @fcmp_constexpr_one(float %conv) {
55 ; CHECK-LABEL: @fcmp_constexpr_one(
56 ; CHECK-NEXT: ret i1 false
58 %cmp = fcmp one float bitcast (i32 ptrtoint (i16* @a to i32) to float), bitcast (i32 ptrtoint (i16* @a to i32) to float)