| 1 |
// RUN: %clang_cc1 -ffp-contract=on -triple x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s |
| 2 |
// Verify that float_control does not pertain to initializer expressions |
| 3 |
|
| 4 |
float y(); |
| 5 |
float z(); |
| 6 |
#pragma float_control(except, on) |
| 7 |
class ON { |
| 8 |
float w = 2 + y() * z(); |
| 9 |
// CHECK-LABEL: define {{.*}} @_ZN2ONC2Ev{{.*}} |
| 10 |
// CHECK: llvm.experimental.constrained.fmul{{.*}}tonearest{{.*}}strict |
| 11 |
}; |
| 12 |
ON on; |
| 13 |
#pragma float_control(except, off) |
| 14 |
class OFF { |
| 15 |
float w = 2 + y() * z(); |
| 16 |
// CHECK-LABEL: define {{.*}} @_ZN3OFFC2Ev{{.*}} |
| 17 |
// CHECK-NOT: llvm.experimental.constrained.fmul{{.*}}tonearest{{.*}}strict |
| 18 |
}; |
| 19 |
OFF off; |