Chandler Carruth | 49589f0 | 2012-07-02 18:37:59 +0000 | [diff] [blame] | 1 | ; RUN: not llvm-as < %s 2>&1 | FileCheck %s |
Duncan Sands | 5e5c5f8 | 2012-04-14 12:36:06 +0000 | [diff] [blame] | 2 | |
Duncan Sands | 8883c43 | 2012-04-16 16:28:59 +0000 | [diff] [blame] | 3 | define void @fpmath1(i32 %i, float %f, <2 x float> %g) { |
Duncan Sands | 5e5c5f8 | 2012-04-14 12:36:06 +0000 | [diff] [blame] | 4 | %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 Sands | 8883c43 | 2012-04-16 16:28:59 +0000 | [diff] [blame] | 11 | ; CHECK: invalid fpmath accuracy! |
Duncan Sands | 5e5c5f8 | 2012-04-14 12:36:06 +0000 | [diff] [blame] | 12 | %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 Sands | 8883c43 | 2012-04-16 16:28:59 +0000 | [diff] [blame] | 17 | ; CHECK: fpmath accuracy not a positive number! |
Duncan Sands | 5e5c5f8 | 2012-04-14 12:36:06 +0000 | [diff] [blame] | 18 | %y = fadd float %f, %f, !fpmath !5 |
Duncan Sands | 8883c43 | 2012-04-16 16:28:59 +0000 | [diff] [blame] | 19 | ; CHECK: fpmath accuracy not a positive number! |
Duncan Sands | 5e5c5f8 | 2012-04-14 12:36:06 +0000 | [diff] [blame] | 20 | %z = fadd float %f, %f, !fpmath !6 |
Duncan Sands | 8883c43 | 2012-04-16 16:28:59 +0000 | [diff] [blame] | 21 | ; CHECK: fpmath accuracy not a positive number! |
| 22 | ret void |
| 23 | } |
| 24 | |
Duncan Sands | 5e5c5f8 | 2012-04-14 12:36:06 +0000 | [diff] [blame] | 25 | !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 Sands | 8883c43 | 2012-04-16 16:28:59 +0000 | [diff] [blame] | 30 | !5 = metadata !{ float 0.0 } |
Duncan Sands | 5e5c5f8 | 2012-04-14 12:36:06 +0000 | [diff] [blame] | 31 | !6 = metadata !{ float 0x7FFFFFFF00000000 } |