Skip to content

Commit 4707468

Browse files
committed
Add support for clang-cl's option -fexcess-precision.
This option is useful for clang and clang-cl. Differential Revision: https://reviews.llvm.org/D141929
1 parent b94e5ff commit 4707468

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,6 +1579,7 @@ def fignore_exceptions : Flag<["-"], "fignore-exceptions">, Group<f_Group>, Flag
15791579
HelpText<"Enable support for ignoring exception handling constructs">,
15801580
MarshallingInfoFlag<LangOpts<"IgnoreExceptions">>;
15811581
def fexcess_precision_EQ : Joined<["-"], "fexcess-precision=">, Group<f_Group>,
1582+
Flags<[CoreOption]>,
15821583
HelpText<"Allows control over excess precision on targets where native "
15831584
"support for the precision types is not available. By default, excess "
15841585
"precision is used to calculate intermediate results following the "

clang/test/Driver/fexcess-precision.c

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,62 @@
11
// RUN: %clang -### -target i386 -fexcess-precision=fast -c %s 2>&1 \
22
// RUN: | FileCheck --check-prefix=CHECK-FAST %s
3+
// RUN: %clang_cl -### -target i386 -fexcess-precision=fast -c %s 2>&1 \
4+
// RUN: | FileCheck --check-prefix=CHECK-FAST %s
5+
36
// RUN: %clang -### -target i386 -fexcess-precision=standard -c %s 2>&1 \
47
// RUN: | FileCheck --check-prefix=CHECK-STD %s
8+
// RUN: %clang_cl -### -target i386 -fexcess-precision=standard -c %s 2>&1 \
9+
// RUN: | FileCheck --check-prefix=CHECK-STD %s
10+
511
// RUN: %clang -### -target i386 -fexcess-precision=16 -c %s 2>&1 \
612
// RUN: | FileCheck --check-prefix=CHECK-NONE %s
13+
// RUN: %clang_cl -### -target i386 -fexcess-precision=16 -c %s 2>&1 \
14+
// RUN: | FileCheck --check-prefix=CHECK-NONE %s
15+
716
// RUN: %clang -### -target i386 -fexcess-precision=none -c %s 2>&1 \
817
// RUN: | FileCheck --check-prefix=CHECK-ERR-NONE %s
18+
// RUN: %clang_cl -### -target i386 -fexcess-precision=none -c %s 2>&1 \
19+
// RUN: | FileCheck --check-prefix=CHECK-ERR-NONE %s
920

1021
// RUN: %clang -### -target x86_64 -fexcess-precision=fast -c %s 2>&1 \
1122
// RUN: | FileCheck --check-prefix=CHECK-FAST %s
23+
// RUN: %clang_cl -### -target x86_64 -fexcess-precision=fast -c %s 2>&1 \
24+
// RUN: | FileCheck --check-prefix=CHECK-FAST %s
25+
1226
// RUN: %clang -### -target x86_64 -fexcess-precision=standard -c %s 2>&1 \
1327
// RUN: | FileCheck --check-prefix=CHECK-STD %s
28+
// RUN: %clang_cl -### -target x86_64 -fexcess-precision=standard -c %s 2>&1 \
29+
// RUN: | FileCheck --check-prefix=CHECK-STD %s
30+
1431
// RUN: %clang -### -target x86_64 -fexcess-precision=16 -c %s 2>&1 \
1532
// RUN: | FileCheck --check-prefix=CHECK-NONE %s
33+
// RUN: %clang_cl -### -target x86_64 -fexcess-precision=16 -c %s 2>&1 \
34+
// RUN: | FileCheck --check-prefix=CHECK-NONE %s
35+
1636
// RUN: %clang -### -target x86_64 -fexcess-precision=none -c %s 2>&1 \
1737
// RUN: | FileCheck --check-prefixes=CHECK-ERR-NONE %s
38+
// RUN: %clang_cl -### -target x86_64 -fexcess-precision=none -c %s 2>&1 \
39+
// RUN: | FileCheck --check-prefixes=CHECK-ERR-NONE %s
1840

1941
// RUN: %clang -### -target aarch64 -fexcess-precision=fast -c %s 2>&1 \
2042
// RUN: | FileCheck --check-prefix=CHECK %s
43+
// RUN: %clang_cl -### -target aarch64 -fexcess-precision=fast -c %s 2>&1 \
44+
// RUN: | FileCheck --check-prefix=CHECK %s
45+
2146
// RUN: %clang -### -target aarch64 -fexcess-precision=standard -c %s 2>&1 \
2247
// RUN: | FileCheck --check-prefix=CHECK %s
48+
// RUN: %clang_cl -### -target aarch64 -fexcess-precision=standard -c %s 2>&1 \
49+
// RUN: | FileCheck --check-prefix=CHECK %s
50+
2351
// RUN: %clang -### -target aarch64 -fexcess-precision=16 -c %s 2>&1 \
2452
// RUN: | FileCheck --check-prefix=CHECK-ERR-16 %s
53+
// RUN: %clang_cl -### -target aarch64 -fexcess-precision=16 -c %s 2>&1 \
54+
// RUN: | FileCheck --check-prefix=CHECK-ERR-16 %s
55+
2556
// RUN: %clang -### -target aarch64 -fexcess-precision=none -c %s 2>&1 \
2657
// RUN: | FileCheck --check-prefix=CHECK-ERR-NONE %s
58+
// RUN: %clang_cl -### -target aarch64 -fexcess-precision=none -c %s 2>&1 \
59+
// RUN: | FileCheck --check-prefix=CHECK-ERR-NONE %s
2760

2861
// CHECK-FAST: "-ffloat16-excess-precision=fast"
2962
// CHECK-STD: "-ffloat16-excess-precision=standard"

0 commit comments

Comments
 (0)