1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt -S -instsimplify < %s | FileCheck %s
3
4declare float @llvm.copysign.f32(float, float)
5declare double @llvm.copysign.f64(double, double)
6
7define float @f32_01() {
8; CHECK-LABEL: @f32_01(
9; CHECK-NEXT:    ret float -1.000000e+00
10;
11  %x = call float @llvm.copysign.f32(float 1.0, float -2.0)
12  ret float %x
13}
14
15define float @f32_02() {
16; CHECK-LABEL: @f32_02(
17; CHECK-NEXT:    ret float 2.000000e+00
18;
19  %x = call float @llvm.copysign.f32(float -2.0, float 1.0)
20  ret float %x
21}
22
23define float @f32_03() {
24; CHECK-LABEL: @f32_03(
25; CHECK-NEXT:    ret float -2.000000e+00
26;
27  %x = call float @llvm.copysign.f32(float -2.0, float -1.0)
28  ret float %x
29}
30
31define double @f64_01() {
32; CHECK-LABEL: @f64_01(
33; CHECK-NEXT:    ret double -1.000000e+00
34;
35  %x = call double @llvm.copysign.f64(double 1.0, double -2.0)
36  ret double %x
37}
38
39define double @f64_02() {
40; CHECK-LABEL: @f64_02(
41; CHECK-NEXT:    ret double 1.000000e+00
42;
43  %x = call double @llvm.copysign.f64(double -1.0, double 2.0)
44  ret double %x
45}
46
47define double @f64_03() {
48; CHECK-LABEL: @f64_03(
49; CHECK-NEXT:    ret double -1.000000e+00
50;
51  %x = call double @llvm.copysign.f64(double -1.0, double -2.0)
52  ret double %x
53}
54