aboutsummaryrefslogtreecommitdiff
path: root/clang/test
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2014-04-11 20:31:22 +0000
committerTom Stellard <thomas.stellard@amd.com>2014-04-11 20:31:22 +0000
commit1b4f99d67ee79a9afe2ac1007ffa047138e729a0 (patch)
tree540a48d5423fa881d44f972f5a91dc4484c3eb8b /clang/test
parent330ff7f94059e4df0338c64aa37e8a4f24a2d3ea (diff)
downloadllvm-1b4f99d67ee79a9afe2ac1007ffa047138e729a0.zip
llvm-1b4f99d67ee79a9afe2ac1007ffa047138e729a0.tar.gz
llvm-1b4f99d67ee79a9afe2ac1007ffa047138e729a0.tar.bz2
Merging r204742:
------------------------------------------------------------------------ r204742 | benny.kra | 2014-03-25 14:02:07 -0400 (Tue, 25 Mar 2014) | 10 lines Fix an logic error in the clang driver preventing crtfastmath.o from linking when -Ofast is used without -ffast-math In gcc using -Ofast forces linking of crtfastmath.o. In the current clang crtfastmath.o is only linked when -ffast-math/-funsafe-math-optimizations passed. It can lead to performance issues, when using only -Ofast without explicit -ffast-math (I faced with it). My patch fixes inconsistency with gcc behaviour and also introduces few tests on it. Patch by Zinovy Nis! Differential Revision: http://llvm-reviews.chandlerc.com/D3114 ------------------------------------------------------------------------ llvm-svn: 206066
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Driver/linux-ld.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/clang/test/Driver/linux-ld.c b/clang/test/Driver/linux-ld.c
index 755fa04..827afb3 100644
--- a/clang/test/Driver/linux-ld.c
+++ b/clang/test/Driver/linux-ld.c
@@ -681,7 +681,7 @@
// CHECK-FSL-PPC64: "{{.*}}{{/|\\\\}}crtbegin.o"
// CHECK-FSL-PPC64: "-L[[SYSROOT]]/usr/lib64/powerpc64-fsl-linux/4.6.2/../.."
//
-// Check that crtfastmath.o is linked with -ffast-math.
+// Check that crtfastmath.o is linked with -ffast-math and with -Ofast.
// RUN: %clang --target=x86_64-unknown-linux -### %s \
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
@@ -691,9 +691,30 @@
// RUN: %clang --target=x86_64-unknown-linux -### %s -funsafe-math-optimizations\
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
+// RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast\
+// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
+// RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast -O3\
+// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
+// RUN: %clang --target=x86_64-unknown-linux -### %s -O3 -Ofast\
+// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
// RUN: %clang --target=x86_64-unknown-linux -### %s -ffast-math -fno-fast-math \
// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
+// RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast -fno-fast-math \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
+// RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast -fno-unsafe-math-optimizations \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
+// RUN: %clang --target=x86_64-unknown-linux -### %s -fno-fast-math -Ofast \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
+// RUN: %clang --target=x86_64-unknown-linux -### %s -fno-unsafe-math-optimizations -Ofast \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
// We don't have crtfastmath.o in the i386 tree, use it to check that file
// detection works.
// RUN: %clang --target=i386-unknown-linux -### %s -ffast-math \