blob: 7002c5c825f74ce887239a7d53330323138424fe [file] [log] [blame]
Chandler Carruth49589f02012-07-02 18:37:59 +00001; RUN: not llvm-as < %s 2>&1 | FileCheck %s
Duncan Sands5e5c5f82012-04-14 12:36:06 +00002
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
Duncan Sands5e5c5f82012-04-14 12:36:06 +000025!0 = metadata !{ float 1.0 }
26!1 = metadata !{ }
27!2 = metadata !{ float 1.0, float 1.0 }
28!3 = metadata !{ i32 1 }
29!4 = metadata !{ float -1.0 }
Duncan Sands8883c432012-04-16 16:28:59 +000030!5 = metadata !{ float 0.0 }
Duncan Sands5e5c5f82012-04-14 12:36:06 +000031!6 = metadata !{ float 0x7FFFFFFF00000000 }