1 ; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=attributes --test FileCheck --test-arg %s --test-arg --input-file %s -o %t
2 ; RUN: FileCheck --check-prefixes=CHECK,RESULT %s < %t
4 ; Test that invalid reductions aren't produced on strictfp functions.
6 ; CHECK-LABEL: define float @strictfp_intrinsic(float %x, float %y)
7 ; RESULT-SAME: [[STRICTFP_ONLY:#[0-9]+]] {
8 define float @strictfp_intrinsic(float %x, float %y) #0 {
9 %val = call float @llvm.experimental.constrained.fadd.f32(float %x, float %y, metadata !"round.tonearest", metadata !"fpexcept.strict")
13 ; CHECK-LABEL: define float @strictfp_callsite(float %x, float %y)
14 ; RESULT-SAME: [[STRICTFP_ONLY]] {
15 ; RESULT: call float @extern.func(float %x, float %y) [[STRICTFP_ONLY]]
16 define float @strictfp_callsite(float %x, float %y) #0 {
17 %val = call float @extern.func(float %x, float %y) #0
21 ; CHECK-LABEL: define float @strictfp_declaration(float %x, float %y)
22 ; RESULT-SAME: [[STRICTFP_ONLY]] {
23 define float @strictfp_declaration(float %x, float %y) #0 {
24 %val = call float @strict.extern.func(float %x, float %y)
28 ; CHECK-LABEL: define float @strictfp_no_constrained_ops(float %x, float %y)
29 ; RESULT-SAME: [[STRICTFP_ONLY]] {
30 define float @strictfp_no_constrained_ops(float %x, float %y) #0 {
31 %val = call float @llvm.copysign.f32(float %x, float %y)
35 ; CHECK-LABEL: declare float @strict.extern.func(float, float)
36 ; RESULT-SAME: [[STRICTFP_ONLY]]{{$}}
37 declare float @strict.extern.func(float, float) #0
39 declare float @extern.func(float, float)
41 declare float @llvm.copysign.f32(float, float) #1
42 declare float @llvm.experimental.constrained.fadd.f32(float, float, metadata, metadata) #2
44 ; RESULT: attributes [[STRICTFP_ONLY]] = { strictfp }
46 attributes #0 = { nounwind strictfp }
47 attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
48 attributes #2 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) }