|
1 | 1 | // RUN: %clang_cc1 -fexperimental-strict-floating-point -ffp-exception-behavior=strict -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck --check-prefixes=CHECK,STRICT %s
|
| 2 | +// RUN: %clang_cc1 -fexperimental-strict-floating-point -frounding-math -ffp-exception-behavior=strict -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck --check-prefixes=CHECK,STRICT-RND %s |
2 | 3 | // RUN: %clang_cc1 -fexperimental-strict-floating-point -ffp-exception-behavior=strict -triple %itanium_abi_triple -emit-llvm %s -o - -fms-extensions -DMS | FileCheck --check-prefixes=CHECK,STRICT %s
|
| 4 | +// RUN: %clang_cc1 -fexperimental-strict-floating-point -frounding-math -ffp-exception-behavior=strict -triple %itanium_abi_triple -emit-llvm %s -o - -fms-extensions -DMS | FileCheck --check-prefixes=CHECK,STRICT-RND %s |
3 | 5 | // RUN: %clang_cc1 -fexperimental-strict-floating-point -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck --check-prefixes=CHECK,DEFAULT %s
|
4 |
| - |
| 6 | +// RUN: %clang_cc1 -fexperimental-strict-floating-point -frounding-math -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck --check-prefixes=CHECK,DEFAULT-RND %s |
5 | 7 |
|
6 | 8 | float func_00(float x, float y) {
|
7 | 9 | return x + y;
|
8 | 10 | }
|
9 | 11 | // CHECK-LABEL: @func_00
|
10 | 12 | // STRICT: call float @llvm.experimental.constrained.fadd.f32(float {{.*}}, float {{.*}}, metadata !"round.tonearest", metadata !"fpexcept.strict")
|
| 13 | +// STRICT-RND: call float @llvm.experimental.constrained.fadd.f32(float {{.*}}, float {{.*}}, metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 14 | +// DEFAULT-RND: call float @llvm.experimental.constrained.fadd.f32(float {{.*}}, float {{.*}}, metadata !"round.dynamic", metadata !"fpexcept.ignore") |
11 | 15 | // DEFAULT: fadd float
|
12 | 16 |
|
13 | 17 |
|
@@ -224,3 +228,17 @@ float func_18(float x, float y) {
|
224 | 228 | // STRICT: call float @llvm.experimental.constrained.fadd.f32(float {{.*}}, float {{.*}}, metadata !"round.tonearest", metadata !"fpexcept.strict")
|
225 | 229 | // DEFAULT: fadd float
|
226 | 230 |
|
| 231 | +#pragma STDC FENV_ACCESS ON |
| 232 | +float func_19(float x, float y) { |
| 233 | + return x + y; |
| 234 | +} |
| 235 | +// CHECK-LABEL: @func_19 |
| 236 | +// STRICT: call float @llvm.experimental.constrained.fadd.f32(float {{.*}}, float {{.*}}, metadata !"round.dynamic", metadata !"fpexcept.strict") |
| 237 | + |
| 238 | +#pragma STDC FENV_ACCESS OFF |
| 239 | +float func_20(float x, float y) { |
| 240 | + return x + y; |
| 241 | +} |
| 242 | +// CHECK-LABEL: @func_20 |
| 243 | +// STRICT: call float @llvm.experimental.constrained.fadd.f32(float {{.*}}, float {{.*}}, metadata !"round.tonearest", metadata !"fpexcept.strict") |
| 244 | +// DEFAULT: fadd float |
0 commit comments