summaryrefslogtreecommitdiffstats
path: root/clang/test/Driver/gold-lto.c
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2013-01-13 11:46:33 +0000
committerChandler Carruth <chandlerc@gmail.com>2013-01-13 11:46:33 +0000
commit953fb087e5ee32e8f2cc696ea54995bf6c4ce9b1 (patch)
tree74b4020a56fb356882ba803cfc1f3583b2b51187 /clang/test/Driver/gold-lto.c
parentbcd14a0f26b74060a2145316792ad81183295c0d (diff)
downloadbcm5719-llvm-953fb087e5ee32e8f2cc696ea54995bf6c4ce9b1.tar.gz
bcm5719-llvm-953fb087e5ee32e8f2cc696ea54995bf6c4ce9b1.zip
Refactor the x86 CPU name logic in the driver and pass -march and -mcpu
flag information down from the Clang driver into the Gold linker plugin for LTO. This allows specifying -march on the linker commandline and should hopefully have it pass all the way through to the LTO optimizer. Fixes PR14697. llvm-svn: 172354
Diffstat (limited to 'clang/test/Driver/gold-lto.c')
-rw-r--r--clang/test/Driver/gold-lto.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/clang/test/Driver/gold-lto.c b/clang/test/Driver/gold-lto.c
index 05ac27aab9f..c2e8bdfbc74 100644
--- a/clang/test/Driver/gold-lto.c
+++ b/clang/test/Driver/gold-lto.c
@@ -1,6 +1,21 @@
// RUN: touch %t.o
-// RUN: %clang -target x86_64-pc-linux-gnu -### %t.o -O4 -Wl,-plugin-opt=foo 2> %t.log
-// RUN: FileCheck %s < %t.log
-
-// CHECK: "-plugin" "{{.*}}/LLVMgold.so"
-// CHECK: "-plugin-opt=foo"
+//
+// RUN: %clang -target x86_64-unknown-linux -### %t.o -flto 2>&1 \
+// RUN: -Wl,-plugin-opt=foo \
+// RUN: | FileCheck %s --check-prefix=CHECK-X86-64-BASIC
+// CHECK-X86-64-BASIC: "-plugin" "{{.*}}/LLVMgold.so"
+// CHECK-X86-64-BASIC: "-plugin-opt=foo"
+//
+// RUN: %clang -target x86_64-unknown-linux -### %t.o -flto 2>&1 \
+// RUN: -march=corei7 -Wl,-plugin-opt=foo \
+// RUN: | FileCheck %s --check-prefix=CHECK-X86-64-COREI7
+// CHECK-X86-64-COREI7: "-plugin" "{{.*}}/LLVMgold.so"
+// CHECK-X86-64-COREI7: "-plugin-opt=mcpu=corei7"
+// CHECK-X86-64-COREI7: "-plugin-opt=foo"
+//
+// RUN: %clang -target arm-unknown-linux -### %t.o -flto 2>&1 \
+// RUN: -march=armv7a -Wl,-plugin-opt=foo \
+// RUN: | FileCheck %s --check-prefix=CHECK-ARM-V7A
+// CHECK-ARM-V7A: "-plugin" "{{.*}}/LLVMgold.so"
+// CHECK-ARM-V7A: "-plugin-opt=mcpu=cortex-a8"
+// CHECK-ARM-V7A: "-plugin-opt=foo"
OpenPOWER on IntegriCloud