Skip to content

Commit 263b348

Browse files
committed
Fixups and tests
1 parent 3b84e05 commit 263b348

File tree

2 files changed

+34
-8
lines changed

2 files changed

+34
-8
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3411,7 +3411,7 @@ def fno_experimental_isel : Flag<["-"], "fno-experimental-isel">, Group<f_clang_
34113411
def fveclib : Joined<["-"], "fveclib=">, Group<f_Group>,
34123412
Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
34133413
HelpText<"Use the given vector functions library."
3414-
"Note: -fveclib={ArmPL,SLEEF} implies -fno-math-errno">,
3414+
"Note: In clang -fveclib={ArmPL,SLEEF} implies -fno-math-errno">,
34153415
Values<"Accelerate,libmvec,MASSV,SVML,SLEEF,Darwin_libsystem_m,ArmPL,AMDLIBM,none">,
34163416
NormalizedValuesScope<"llvm::driver::VectorLibrary">,
34173417
NormalizedValues<["Accelerate", "LIBMVEC", "MASSV", "SVML", "SLEEF",

clang/test/Driver/fveclib.c

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,49 @@
3636
/* Verify that the correct vector library is passed to LTO flags. */
3737

3838
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fveclib=LIBMVEC -flto %s 2>&1 | FileCheck --check-prefix=CHECK-LTO-LIBMVEC %s
39-
// CHECK-LTO-LIBMVEC: "-fmath-errno"
4039
// CHECK-LTO-LIBMVEC: "-plugin-opt=-vector-library=LIBMVEC-X86"
4140

4241
// RUN: %clang -### --target=powerpc64-unknown-linux-gnu -fveclib=MASSV -flto %s 2>&1 | FileCheck --check-prefix=CHECK-LTO-MASSV %s
43-
// CHECK-LTO-MASSV: "-fmath-errno"
4442
// CHECK-LTO-MASSV: "-plugin-opt=-vector-library=MASSV"
4543

4644
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fveclib=SVML -flto %s 2>&1 | FileCheck --check-prefix=CHECK-LTO-SVML %s
47-
// CHECK-LTO-SVML: "-fmath-errno"
4845
// CHECK-LTO-SVML: "-plugin-opt=-vector-library=SVML"
4946

5047
// RUN: %clang -### --target=aarch64-linux-gnu -fveclib=SLEEF -flto %s 2>&1 | FileCheck --check-prefix=CHECK-LTO-SLEEF %s
51-
// CHECK-LTO-SLEEF-NOT: "-fmath-errno"
5248
// CHECK-LTO-SLEEF: "-plugin-opt=-vector-library=sleefgnuabi"
53-
// CHECK-LTO-SLEEF-NOT: "-fmath-errno"
5449

5550
// RUN: %clang -### --target=aarch64-linux-gnu -fveclib=ArmPL -flto %s 2>&1 | FileCheck --check-prefix=CHECK-LTO-ARMPL %s
56-
// CHECK-LTO-ARMPL-NOT: "-fmath-errno"
5751
// CHECK-LTO-ARMPL: "-plugin-opt=-vector-library=ArmPL"
58-
// CHECK-LTO-ARMPL-NOT: "-fmath-errno"
52+
53+
54+
/* Verify that -fmath-errno is set correctly for the vector library. */
55+
56+
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fveclib=LIBMVEC %s 2>&1 | FileCheck --check-prefix=CHECK-ERRNO-LIBMVEC %s
57+
// CHECK-ERRNO-LIBMVEC: "-fveclib=LIBMVEC"
58+
// CHECK-ERRNO-LIBMVEC-SAME: "-fmath-errno"
59+
60+
// RUN: %clang -### --target=powerpc64-unknown-linux-gnu -fveclib=MASSV %s 2>&1 | FileCheck --check-prefix=CHECK-ERRNO-MASSV %s
61+
// CHECK-ERRNO-MASSV: "-fveclib=MASSV"
62+
// CHECK-ERRNO-MASSV-SAME: "-fmath-errno"
63+
64+
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fveclib=SVML %s 2>&1 | FileCheck --check-prefix=CHECK-ERRNO-SVML %s
65+
// CHECK-ERRNO-SVML: "-fveclib=SVML"
66+
// CHECK-ERRNO-SVML-SAME: "-fmath-errno"
67+
68+
// RUN: %clang -### --target=aarch64-linux-gnu -fveclib=SLEEF %s 2>&1 | FileCheck --check-prefix=CHECK-ERRNO-SLEEF %s
69+
// CHECK-ERRNO-SLEEF-NOT: "-fmath-errno"
70+
// CHECK-ERRNO-SLEEF: "-fveclib=SLEEF"
71+
// CHECK-ERRNO-SLEEF-NOT: "-fmath-errno"
72+
73+
// RUN: %clang -### --target=aarch64-linux-gnu -fveclib=ArmPL %s 2>&1 | FileCheck --check-prefix=CHECK-ERRNO-ARMPL %s
74+
// CHECK-ERRNO-ARMPL-NOT: "-fmath-errno"
75+
// CHECK-ERRNO-ARMPL: "-fveclib=ArmPL"
76+
// CHECK-ERRNO-ARMPL-NOT: "-fmath-errno"
77+
78+
// RUN: %clang -### --target=aarch64-linux-gnu -fveclib=ArmPL -fmath-errno %s 2>&1 | FileCheck --check-prefix=CHECK-FORCE-ERRNO-ARMPL %s
79+
// CHECK-FORCE-ERRNO-ARMPL: "-fveclib=ArmPL"
80+
// CHECK-FORCE-ERRNO-ARMPL-SAME: "-fmath-errno"
81+
82+
// RUN: %clang -### --target=aarch64-linux-gnu -fveclib=SLEEF -fmath-errno %s 2>&1 | FileCheck --check-prefix=CHECK-FORCE-ERRNO-SLEEF %s
83+
// CHECK-FORCE-ERRNO-SLEEF: "-fveclib=SLEEF"
84+
// CHECK-FORCE-ERRNO-SLEEF-SAME: "-fmath-errno"

0 commit comments

Comments
 (0)