1*7ab80309SJan Svoboda // RUN: %clang_cc1 -x c++ -fexceptions -fcxx-exceptions -frounding-math -ffp-exception-behavior=strict -fexperimental-strict-floating-point -emit-llvm -o - %s | FileCheck %s -check-prefix=FPMODELSTRICT
27f9b5138SMelanie Blower // RUN: %clang_cc1 -x c++ -ffp-contract=fast -fexceptions -fcxx-exceptions -emit-llvm -o - %s | FileCheck %s -check-prefix=PRECISE
37f9b5138SMelanie Blower // RUN: %clang_cc1 -x c++ -ffast-math -fexceptions -fcxx-exceptions -ffp-contract=fast -emit-llvm -o - %s | FileCheck %s -check-prefix=FAST
4f5360d4bSMelanie Blower // RUN: %clang_cc1 -x c++ -ffast-math -fexceptions -fcxx-exceptions -emit-llvm -o - %s | FileCheck %s -check-prefix=FASTNOCONTRACT
57f9b5138SMelanie Blower // RUN: %clang_cc1 -x c++ -ffast-math -fexceptions -fcxx-exceptions -ffp-contract=fast -ffp-exception-behavior=ignore -emit-llvm -o - %s | FileCheck %s -check-prefix=FAST
6d4ce862fSKevin P. Neal // RUN: %clang_cc1 -x c++ -ffast-math -fexceptions -fcxx-exceptions -ffp-contract=fast -ffp-exception-behavior=strict -fexperimental-strict-floating-point -emit-llvm -o - %s | FileCheck %s -check-prefix=EXCEPT
7d4ce862fSKevin P. Neal // RUN: %clang_cc1 -x c++ -ffast-math -fexceptions -fcxx-exceptions -ffp-contract=fast -ffp-exception-behavior=maytrap -fexperimental-strict-floating-point -emit-llvm -o - %s | FileCheck %s -check-prefix=MAYTRAP
8d4ce862fSKevin P. Neal 
97f9b5138SMelanie Blower float f0, f1, f2;
107f9b5138SMelanie Blower 
117f9b5138SMelanie Blower   template <class>
127f9b5138SMelanie Blower   class aaaa {
137f9b5138SMelanie Blower    public:
147f9b5138SMelanie Blower     ~aaaa();
157f9b5138SMelanie Blower     void b();
167f9b5138SMelanie Blower   };
177f9b5138SMelanie Blower 
187f9b5138SMelanie Blower   template <class c>
~aaaa()197f9b5138SMelanie Blower   aaaa<c>::~aaaa() { try {
207f9b5138SMelanie Blower     b();
217f9b5138SMelanie Blower   // CHECK-LABEL: define {{.*}}void @_ZN4aaaaIiED2Ev{{.*}}
227f9b5138SMelanie Blower 
237f9b5138SMelanie Blower   } catch (...) {
247f9b5138SMelanie Blower     // MAYTRAP: llvm.experimental.constrained.fadd.f32(float %{{.*}}, float %{{.*}}, metadata !"round.tonearest", metadata !"fpexcept.maytrap")
257f9b5138SMelanie Blower     // EXCEPT: llvm.experimental.constrained.fadd.f32(float %{{.*}}, float %{{.*}}, metadata !"round.tonearest", metadata !"fpexcept.strict")
267f9b5138SMelanie Blower     // FPMODELSTRICT: llvm.experimental.constrained.fadd.f32(float %{{.*}}, float %{{.*}}, metadata !"round.dynamic", metadata !"fpexcept.strict")
277f9b5138SMelanie Blower     // STRICTEXCEPT: llvm.experimental.constrained.fadd.f32(float %{{.*}}, float %{{.*}}, metadata !"round.dynamic", metadata !"fpexcept.strict")
287f9b5138SMelanie Blower     // STRICTNOEXCEPT: llvm.experimental.constrained.fadd.f32(float %{{.*}}, float %{{.*}}, metadata !"round.dynamic", metadata !"fpexcept.ignore")
297f9b5138SMelanie Blower     // PRECISE: fadd contract float %{{.*}}, %{{.*}}
307f9b5138SMelanie Blower     // FAST: fadd fast
31f5360d4bSMelanie Blower     // FASTNOCONTRACT: fadd reassoc nnan ninf nsz arcp afn float
327f9b5138SMelanie Blower     f0 = f1 + f2;
337f9b5138SMelanie Blower 
347f9b5138SMelanie Blower     // CHECK: ret void
357f9b5138SMelanie Blower   }
367f9b5138SMelanie Blower   }
377f9b5138SMelanie Blower 
387f9b5138SMelanie Blower   class d {
397f9b5138SMelanie Blower    public:
407f9b5138SMelanie Blower     d(const char *, int);
417f9b5138SMelanie Blower     aaaa<int> e;
427f9b5138SMelanie Blower   };
437f9b5138SMelanie Blower 
foo()447f9b5138SMelanie Blower float foo() {
457f9b5138SMelanie Blower   d x("", 1);
467f9b5138SMelanie Blower   aaaa<int> a;
477f9b5138SMelanie Blower   return f0;
487f9b5138SMelanie Blower }
497f9b5138SMelanie Blower 
50