blob: 79e023318fab79a49d6ec0ac8e2ab60c09ad0820 [file] [log] [blame]
James Molloyee0d9922015-07-10 12:52:00 +00001; RUN: llvm-as < %s | llvm-dis > %t0
2; RUN: opt -S < %s > %t1
3; RUN: diff %t0 %t1
4; RUN: FileCheck < %t1 %s
5
Michael Berg16388e72018-04-26 18:17:58 +00006; Make sure fast math flags on fcmp instructions are serialized/deserialized properly.
James Molloyee0d9922015-07-10 12:52:00 +00007
8define i1 @foo(float %a, float %b, double %c, double %d) {
9 ; CHECK: %plain = fcmp ueq float %a, %b
10 %plain = fcmp ueq float %a, %b
11 ; CHECK: %fast = fcmp fast olt float %a, %b
12 %fast = fcmp fast olt float %a, %b
13 ; CHECK: %nsz = fcmp nsz uge float %a, %b
14 %nsz = fcmp nsz uge float %a, %b
15 ; CHECK: %nnan = fcmp nnan nsz oge double %c, %d
16 %nnan = fcmp nnan nsz oge double %c, %d
17
18 %dce1 = or i1 %plain, %fast
19 %dce2 = or i1 %dce1, %nsz
20 %dce3 = or i1 %dce2, %nnan
21
22 ret i1 %dce3
23}