xref: /llvm-project/flang/test/Driver/func-attr-fast-math.f90 (revision 22544e2a54370a3c0b12765981c312f9ec04f1cc)
1! RUN: %flang -O1 -emit-llvm -S -o - %s 2>&1| FileCheck %s --check-prefix=CHECK-NOFASTMATH
2! RUN: %flang -Ofast -emit-llvm -S -o - %s 2>&1| FileCheck %s --check-prefix=CHECK-OFAST
3! RUN: %flang -O1 -ffast-math -emit-llvm -S -o - %s 2>&1| FileCheck %s --check-prefix=CHECK-FFAST-MATH
4
5subroutine func
6end subroutine func
7
8! CHECK-NOFASTMATH-LABEL: define void @func_() local_unnamed_addr
9! CHECK-NOFASTMATH-SAME: #[[ATTRS:[0-9]+]]
10! CHECK-NOT fp-math"=
11
12! CHECK-OFAST-LABEL: define void @func_() local_unnamed_addr
13! CHECK-OFAST-SAME: #[[ATTRS:[0-9]+]]
14! CHECK-OFAST: attributes #[[ATTRS]] = { {{.*}}"approx-func-fp-math"="true" {{.*}}"no-infs-fp-math"="true" {{.*}}"no-nans-fp-math"="true" {{.*}}"no-signed-zeros-fp-math"="true" {{.*}}"unsafe-fp-math"="true"{{.*}} }
15
16! CHECK-FFAST-MATH-LABEL: define void @func_() local_unnamed_addr
17! CHECK-FFAST-MATH-SAME: #[[ATTRS:[0-9]+]]
18! CHECK-FFAST-MATH: attributes #[[ATTRS]] = { {{.*}}"approx-func-fp-math"="true" {{.*}}"no-infs-fp-math"="true" {{.*}}"no-nans-fp-math"="true" {{.*}}"no-signed-zeros-fp-math"="true" {{.*}}"unsafe-fp-math"="true"{{.*}} }
19