Add support for clang-cl's option -fexcess-precision.

This option is useful for clang and clang-cl.

Differential Revision: https://reviews.llvm.org/D142367
This commit is contained in:
Zahira Ammarguellat 2023-01-23 10:40:10 -05:00
parent 365ce62df2
commit 3759ef9e56
2 changed files with 37 additions and 0 deletions

View File

@ -1579,6 +1579,7 @@ def fignore_exceptions : Flag<["-"], "fignore-exceptions">, Group<f_Group>, Flag
HelpText<"Enable support for ignoring exception handling constructs">,
MarshallingInfoFlag<LangOpts<"IgnoreExceptions">>;
def fexcess_precision_EQ : Joined<["-"], "fexcess-precision=">, Group<f_Group>,
Flags<[CoreOption]>,
HelpText<"Allows control over excess precision on targets where native "
"support for the precision types is not available. By default, excess "
"precision is used to calculate intermediate results following the "

View File

@ -1,29 +1,65 @@
// Note: %s must be preceded by --, otherwise it may be interpreted as a
// command-line option, e.g. on Mac where %s is commonly under /Users.
// RUN: %clang -### -target i386 -fexcess-precision=fast -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-FAST %s
// RUN: %clang_cl -### -target i386 -fexcess-precision=fast -c -- %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-FAST %s
// RUN: %clang -### -target i386 -fexcess-precision=standard -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-STD %s
// RUN: %clang_cl -### -target i386 -fexcess-precision=standard -c -- %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-STD %s
// RUN: %clang -### -target i386 -fexcess-precision=16 -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NONE %s
// RUN: %clang_cl -### -target i386 -fexcess-precision=16 -c -- %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NONE %s
// RUN: %clang -### -target i386 -fexcess-precision=none -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-ERR-NONE %s
// RUN: %clang_cl -### -target i386 -fexcess-precision=none -c -- %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-ERR-NONE %s
// RUN: %clang -### -target x86_64 -fexcess-precision=fast -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-FAST %s
// RUN: %clang_cl -### -target x86_64 -fexcess-precision=fast -c -- %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-FAST %s
// RUN: %clang -### -target x86_64 -fexcess-precision=standard -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-STD %s
// RUN: %clang_cl -### -target x86_64 -fexcess-precision=standard -c \
// RUN: -- %s 2>&1 | FileCheck --check-prefix=CHECK-STD %s
// RUN: %clang -### -target x86_64 -fexcess-precision=16 -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NONE %s
// RUN: %clang_cl -### -target x86_64 -fexcess-precision=16 -c -- %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NONE %s
// RUN: %clang -### -target x86_64 -fexcess-precision=none -c %s 2>&1 \
// RUN: | FileCheck --check-prefixes=CHECK-ERR-NONE %s
// RUN: %clang_cl -### -target x86_64 -fexcess-precision=none -c -- %s 2>&1 \
// RUN: | FileCheck --check-prefixes=CHECK-ERR-NONE %s
// RUN: %clang -### -target aarch64 -fexcess-precision=fast -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK %s
// RUN: %clang_cl -### -target aarch64 -fexcess-precision=fast -c -- %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK %s
// RUN: %clang -### -target aarch64 -fexcess-precision=standard -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK %s
// RUN: %clang_cl -### -target aarch64 -fexcess-precision=standard -c \
// RUN: -- %s 2>&1 | FileCheck --check-prefix=CHECK %s
// RUN: %clang -### -target aarch64 -fexcess-precision=16 -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-ERR-16 %s
// RUN: %clang_cl -### -target aarch64 -fexcess-precision=16 -c -- %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-ERR-16 %s
// RUN: %clang -### -target aarch64 -fexcess-precision=none -c %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-ERR-NONE %s
// RUN: %clang_cl -### -target aarch64 -fexcess-precision=none -c -- %s 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-ERR-NONE %s
// CHECK-FAST: "-ffloat16-excess-precision=fast"
// CHECK-STD: "-ffloat16-excess-precision=standard"