xref: /aosp_15_r20/external/llvm/test/Verifier/fpmath.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: not llvm-as < %s 2>&1 | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Workerdefine void @fpmath1(i32 %i, float %f, <2 x float> %g) {
4*9880d681SAndroid Build Coastguard Worker  %s = add i32 %i, %i, !fpmath !0
5*9880d681SAndroid Build Coastguard Worker; CHECK: fpmath requires a floating point result!
6*9880d681SAndroid Build Coastguard Worker  %t = fadd float %f, %f, !fpmath !1
7*9880d681SAndroid Build Coastguard Worker; CHECK: fpmath takes one operand!
8*9880d681SAndroid Build Coastguard Worker  %u = fadd float %f, %f, !fpmath !2
9*9880d681SAndroid Build Coastguard Worker; CHECK: fpmath takes one operand!
10*9880d681SAndroid Build Coastguard Worker  %v = fadd float %f, %f, !fpmath !3
11*9880d681SAndroid Build Coastguard Worker; CHECK: invalid fpmath accuracy!
12*9880d681SAndroid Build Coastguard Worker  %w = fadd float %f, %f, !fpmath !0
13*9880d681SAndroid Build Coastguard Worker; Above line is correct.
14*9880d681SAndroid Build Coastguard Worker  %w2 = fadd <2 x float> %g, %g, !fpmath !0
15*9880d681SAndroid Build Coastguard Worker; Above line is correct.
16*9880d681SAndroid Build Coastguard Worker  %x = fadd float %f, %f, !fpmath !4
17*9880d681SAndroid Build Coastguard Worker; CHECK: fpmath accuracy not a positive number!
18*9880d681SAndroid Build Coastguard Worker  %y = fadd float %f, %f, !fpmath !5
19*9880d681SAndroid Build Coastguard Worker; CHECK: fpmath accuracy not a positive number!
20*9880d681SAndroid Build Coastguard Worker  %z = fadd float %f, %f, !fpmath !6
21*9880d681SAndroid Build Coastguard Worker; CHECK: fpmath accuracy not a positive number!
22*9880d681SAndroid Build Coastguard Worker  %double.fpmath = fadd float %f, %f, !fpmath !7
23*9880d681SAndroid Build Coastguard Worker; CHECK: fpmath accuracy must have float type
24*9880d681SAndroid Build Coastguard Worker  ret void
25*9880d681SAndroid Build Coastguard Worker}
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard Worker!0 = !{ float 1.0 }
28*9880d681SAndroid Build Coastguard Worker!1 = !{ }
29*9880d681SAndroid Build Coastguard Worker!2 = !{ float 1.0, float 1.0 }
30*9880d681SAndroid Build Coastguard Worker!3 = !{ i32 1 }
31*9880d681SAndroid Build Coastguard Worker!4 = !{ float -1.0 }
32*9880d681SAndroid Build Coastguard Worker!5 = !{ float 0.0 }
33*9880d681SAndroid Build Coastguard Worker!6 = !{ float 0x7FFFFFFF00000000 }
34*9880d681SAndroid Build Coastguard Worker!7 = !{ double 1.0 }
35