llvm-project/clang/test/CodeGen/fp-floatcontrol-class.cpp
Melanie Blower 827be690dc [clang] FastMathFlags.allowContract should be initialized only from FPFeatures.allowFPContractAcrossStatement
Summary: Fix bug introduced in D72841 adding support for pragma float_control

Reviewers: rjmccall, Anastasia

Differential Revision: https://reviews.llvm.org/D79903
2020-05-20 06:19:10 -07:00

21 lines
640 B
C++

// RUN: %clang_cc1 -ffp-contract=on -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -ffp-contract=on -triple x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s
// Verify that float_control does not pertain to initializer expressions
float y();
float z();
#pragma float_control(except, on)
class ON {
float w = 2 + y() * z();
// CHECK-LABEL: define {{.*}} @_ZN2ONC2Ev{{.*}}
//CHECK: call float {{.*}}llvm.fmuladd
};
ON on;
#pragma float_control(except, off)
class OFF {
float w = 2 + y() * z();
// CHECK-LABEL: define {{.*}} @_ZN3OFFC2Ev{{.*}}
//CHECK: call float {{.*}}llvm.fmuladd
};
OFF off;