2020-05-02 01:32:06 +08:00
|
|
|
// 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();
|
2020-05-04 22:25:23 +08:00
|
|
|
// CHECK-LABEL: define {{.*}} @_ZN2ONC2Ev{{.*}}
|
2021-07-30 00:02:20 +08:00
|
|
|
// CHECK: llvm.experimental.constrained.fmul{{.*}}tonearest{{.*}}strict
|
2020-05-02 01:32:06 +08:00
|
|
|
};
|
|
|
|
ON on;
|
|
|
|
#pragma float_control(except, off)
|
|
|
|
class OFF {
|
|
|
|
float w = 2 + y() * z();
|
2020-05-04 22:25:23 +08:00
|
|
|
// CHECK-LABEL: define {{.*}} @_ZN3OFFC2Ev{{.*}}
|
2021-07-30 00:02:20 +08:00
|
|
|
// CHECK-NOT: llvm.experimental.constrained.fmul{{.*}}tonearest{{.*}}strict
|
2020-05-02 01:32:06 +08:00
|
|
|
};
|
|
|
|
OFF off;
|