blob: a7d3ea8e8988e5b289590314439391a4a357ce59 [file] [log] [blame]
Duncan Sands5e5c5f82012-04-14 12:36:06 +00001; RUN: not llvm-as < %s |& FileCheck %s
2
Duncan Sands8883c432012-04-16 16:28:59 +00003define void @fpmath1(i32 %i, float %f, <2 x float> %g) {
Duncan Sands5e5c5f82012-04-14 12:36:06 +00004 %s = add i32 %i, %i, !fpmath !0
5; CHECK: fpmath requires a floating point result!
6 %t = fadd float %f, %f, !fpmath !1
7; CHECK: fpmath takes one operand!
8 %u = fadd float %f, %f, !fpmath !2
9; CHECK: fpmath takes one operand!
10 %v = fadd float %f, %f, !fpmath !3
Duncan Sands8883c432012-04-16 16:28:59 +000011; CHECK: invalid fpmath accuracy!
Duncan Sands5e5c5f82012-04-14 12:36:06 +000012 %w = fadd float %f, %f, !fpmath !0
13; Above line is correct.
14 %w2 = fadd <2 x float> %g, %g, !fpmath !0
15; Above line is correct.
16 %x = fadd float %f, %f, !fpmath !4
Duncan Sands8883c432012-04-16 16:28:59 +000017; CHECK: fpmath accuracy not a positive number!
Duncan Sands5e5c5f82012-04-14 12:36:06 +000018 %y = fadd float %f, %f, !fpmath !5
Duncan Sands8883c432012-04-16 16:28:59 +000019; CHECK: fpmath accuracy not a positive number!
Duncan Sands5e5c5f82012-04-14 12:36:06 +000020 %z = fadd float %f, %f, !fpmath !6
Duncan Sands8883c432012-04-16 16:28:59 +000021; CHECK: fpmath accuracy not a positive number!
22 ret void
23}
24
25define void @fpmath2(float %f, <2 x float> %g) {
26 %w = fadd float %f, %f, !fpmath !7
27; Above line is correct.
28 %w2 = fadd <2 x float> %g, %g, !fpmath !7
29; Above line is correct.
30 %x = fadd float %f, %f, !fpmath !8
31; CHECK: wrong fpmath accuracy keyword!
Duncan Sands5e5c5f82012-04-14 12:36:06 +000032 ret void
33}
34
35!0 = metadata !{ float 1.0 }
36!1 = metadata !{ }
37!2 = metadata !{ float 1.0, float 1.0 }
38!3 = metadata !{ i32 1 }
39!4 = metadata !{ float -1.0 }
Duncan Sands8883c432012-04-16 16:28:59 +000040!5 = metadata !{ float 0.0 }
Duncan Sands5e5c5f82012-04-14 12:36:06 +000041!6 = metadata !{ float 0x7FFFFFFF00000000 }
Duncan Sands8883c432012-04-16 16:28:59 +000042!7 = metadata !{ metadata !"fast" }
43!8 = metadata !{ metadata !"slow" }