Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/test/Verifier/fp-intrinsics.ll
Show All 9 Lines | |||||
; Test that the verifier accepts legal code, and that the correct attributes are | ; Test that the verifier accepts legal code, and that the correct attributes are | ||||
; attached to the FP intrinsic. | ; attached to the FP intrinsic. | ||||
; CHECK1: declare double @llvm.experimental.constrained.fadd.f64(double, double, metadata, metadata) #[[ATTR:[0-9]+]] | ; CHECK1: declare double @llvm.experimental.constrained.fadd.f64(double, double, metadata, metadata) #[[ATTR:[0-9]+]] | ||||
; CHECK1: declare double @llvm.experimental.constrained.sqrt.f64(double, metadata, metadata) #[[ATTR]] | ; CHECK1: declare double @llvm.experimental.constrained.sqrt.f64(double, metadata, metadata) #[[ATTR]] | ||||
; CHECK1: attributes #[[ATTR]] = { inaccessiblememonly nounwind willreturn } | ; CHECK1: attributes #[[ATTR]] = { inaccessiblememonly nounwind willreturn } | ||||
; Note: FP exceptions aren't usually caught through normal unwind mechanisms, | ; Note: FP exceptions aren't usually caught through normal unwind mechanisms, | ||||
; but we may want to revisit this for asynchronous exception handling. | ; but we may want to revisit this for asynchronous exception handling. | ||||
define double @f1(double %a, double %b) { | define double @f1(double %a, double %b) #0 { | ||||
entry: | entry: | ||||
%fadd = call double @llvm.experimental.constrained.fadd.f64( | %fadd = call double @llvm.experimental.constrained.fadd.f64( | ||||
double %a, double %b, | double %a, double %b, | ||||
metadata !"round.dynamic", | metadata !"round.dynamic", | ||||
metadata !"fpexcept.strict") | metadata !"fpexcept.strict") #0 | ||||
ret double %fadd | ret double %fadd | ||||
} | } | ||||
define double @f1u(double %a) { | define double @f1u(double %a) #0 { | ||||
entry: | entry: | ||||
%fsqrt = call double @llvm.experimental.constrained.sqrt.f64( | %fsqrt = call double @llvm.experimental.constrained.sqrt.f64( | ||||
double %a, | double %a, | ||||
metadata !"round.dynamic", | metadata !"round.dynamic", | ||||
metadata !"fpexcept.strict") | metadata !"fpexcept.strict") #0 | ||||
ret double %fsqrt | ret double %fsqrt | ||||
} | } | ||||
; Test an illegal value for the rounding mode argument. | ; Test an illegal value for the rounding mode argument. | ||||
; CHECK2: invalid rounding mode argument | ; CHECK2: invalid rounding mode argument | ||||
;T2: define double @f2(double %a, double %b) { | ;T2: define double @f2(double %a, double %b) #0 { | ||||
;T2: entry: | ;T2: entry: | ||||
;T2: %fadd = call double @llvm.experimental.constrained.fadd.f64( | ;T2: %fadd = call double @llvm.experimental.constrained.fadd.f64( | ||||
;T2: double %a, double %b, | ;T2: double %a, double %b, | ||||
;T2: metadata !"round.dynomite", | ;T2: metadata !"round.dynomite", | ||||
;T2: metadata !"fpexcept.strict") | ;T2: metadata !"fpexcept.strict") #0 | ||||
;T2: ret double %fadd | ;T2: ret double %fadd | ||||
;T2: } | ;T2: } | ||||
; Test an illegal value for the exception behavior argument. | ; Test an illegal value for the exception behavior argument. | ||||
; CHECK3: invalid exception behavior argument | ; CHECK3: invalid exception behavior argument | ||||
;T3: define double @f3(double %a, double %b) { | ;T3: define double @f3(double %a, double %b) #0 { | ||||
;T3: entry: | ;T3: entry: | ||||
;T3: %fadd = call double @llvm.experimental.constrained.fadd.f64( | ;T3: %fadd = call double @llvm.experimental.constrained.fadd.f64( | ||||
;T3: double %a, double %b, | ;T3: double %a, double %b, | ||||
;T3: metadata !"round.dynamic", | ;T3: metadata !"round.dynamic", | ||||
;T3: metadata !"fpexcept.restrict") | ;T3: metadata !"fpexcept.restrict") #0 | ||||
;T3: ret double %fadd | ;T3: ret double %fadd | ||||
;T3: } | ;T3: } | ||||
; Test an illegal value for the rounding mode argument. | ; Test an illegal value for the rounding mode argument. | ||||
; CHECK4: invalid rounding mode argument | ; CHECK4: invalid rounding mode argument | ||||
;T4: define double @f4(double %a) { | ;T4: define double @f4(double %a) #0 { | ||||
;T4: entry: | ;T4: entry: | ||||
;T4: %fadd = call double @llvm.experimental.constrained.sqrt.f64( | ;T4: %fadd = call double @llvm.experimental.constrained.sqrt.f64( | ||||
;T4: double %a, | ;T4: double %a, | ||||
;T4: metadata !"round.dynomite", | ;T4: metadata !"round.dynomite", | ||||
;T4: metadata !"fpexcept.strict") | ;T4: metadata !"fpexcept.strict") #0 | ||||
;T4: ret double %fadd | ;T4: ret double %fadd | ||||
;T4: } | ;T4: } | ||||
; Test an illegal value for the exception behavior argument. | ; Test an illegal value for the exception behavior argument. | ||||
; CHECK5: invalid exception behavior argument | ; CHECK5: invalid exception behavior argument | ||||
;T5: define double @f5(double %a) { | ;T5: define double @f5(double %a) #0 { | ||||
;T5: entry: | ;T5: entry: | ||||
;T5: %fadd = call double @llvm.experimental.constrained.sqrt.f64( | ;T5: %fadd = call double @llvm.experimental.constrained.sqrt.f64( | ||||
;T5: double %a, | ;T5: double %a, | ||||
;T5: metadata !"round.dynamic", | ;T5: metadata !"round.dynamic", | ||||
;T5: metadata !"fpexcept.restrict") | ;T5: metadata !"fpexcept.restrict") #0 | ||||
;T5: ret double %fadd | ;T5: ret double %fadd | ||||
;T5: } | ;T5: } | ||||
attributes #0 = { strictfp } |