blob: 4a2e6eea6f15785601c0e36d7a38f9202a10eae0 [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!
Matt Arsenault1d88d3b2016-06-27 19:43:15 +000022 %double.fpmath = fadd float %f, %f, !fpmath !7
23; CHECK: fpmath accuracy must have float type
Duncan Sands8883c432012-04-16 16:28:59 +000024 ret void
25}
26
Duncan P. N. Exon Smith1ef70ff2014-12-15 19:07:53 +000027!0 = !{ float 1.0 }
28!1 = !{ }
29!2 = !{ float 1.0, float 1.0 }
30!3 = !{ i32 1 }
31!4 = !{ float -1.0 }
32!5 = !{ float 0.0 }
33!6 = !{ float 0x7FFFFFFF00000000 }
Matt Arsenault1d88d3b2016-06-27 19:43:15 +000034!7 = !{ double 1.0 }