summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2017-08-15 21:31:17 +0000
committerDan Albert <danalbert@google.com>2017-08-15 21:31:17 +0000
commitfe9f1e60c517e71bd819cab9e90b110457ca42b6 (patch)
tree883390223c3abf3d7220a8f094fd921265fb831a /clang/test
parentbb93483c119b92c1ec2b7a58505e21b9dce6a333 (diff)
downloadbcm5719-llvm-fe9f1e60c517e71bd819cab9e90b110457ca42b6.tar.gz
bcm5719-llvm-fe9f1e60c517e71bd819cab9e90b110457ca42b6.zip
Revert "Revert "Fix LLVMgold plugin name/path for non-Linux.""
Summary: Relanding https://reviews.llvm.org/D35739 which was reverted because it broke the tests on non-Linux. The tests have been fixed to be platform agnostic, and additional tests have been added to make sure that the plugin has the correct extension on each platform (%pluginext doesn't work in CHECK lines). Reviewers: srhines, pirama Reviewed By: srhines Subscribers: emaste, mehdi_amini, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D36769 llvm-svn: 310960
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Driver/freebsd.c2
-rw-r--r--clang/test/Driver/gold-lto.c8
-rw-r--r--clang/test/Driver/lto-plugin-darwin.c6
-rw-r--r--clang/test/Driver/lto-plugin-linux.c6
-rw-r--r--clang/test/Driver/lto-plugin-windows.c6
-rw-r--r--clang/test/Driver/lto.c6
-rw-r--r--clang/test/Driver/thinlto.c6
7 files changed, 29 insertions, 11 deletions
diff --git a/clang/test/Driver/freebsd.c b/clang/test/Driver/freebsd.c
index f008b76b93a..215131a9bfc 100644
--- a/clang/test/Driver/freebsd.c
+++ b/clang/test/Driver/freebsd.c
@@ -127,7 +127,7 @@
// RUN: %clang -target x86_64-pc-freebsd8 %s -### -flto 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-LTO %s
-// CHECK-LTO: ld{{.*}}" "-plugin{{.*}}LLVMgold.so
+// CHECK-LTO: ld{{.*}}" "-plugin{{.*}}LLVMgold.{{dll|dylib|so}}
// RUN: %clang -target sparc-unknown-freebsd8 %s -### -fpic -no-integrated-as 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-SPARC-PIE %s
diff --git a/clang/test/Driver/gold-lto.c b/clang/test/Driver/gold-lto.c
index b8eca5112b5..b8ec49fd27c 100644
--- a/clang/test/Driver/gold-lto.c
+++ b/clang/test/Driver/gold-lto.c
@@ -3,14 +3,14 @@
// RUN: %clang -target x86_64-unknown-linux -### %t.o -flto 2>&1 \
// RUN: -Wl,-plugin-opt=foo -O3 \
// RUN: | FileCheck %s --check-prefix=CHECK-X86-64-BASIC
-// CHECK-X86-64-BASIC: "-plugin" "{{.*}}/LLVMgold.so"
+// CHECK-X86-64-BASIC: "-plugin" "{{.*}}/LLVMgold.{{dll|dylib|so}}"
// CHECK-X86-64-BASIC: "-plugin-opt=O3"
// 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 -Ofast \
// RUN: | FileCheck %s --check-prefix=CHECK-X86-64-COREI7
-// CHECK-X86-64-COREI7: "-plugin" "{{.*}}/LLVMgold.so"
+// CHECK-X86-64-COREI7: "-plugin" "{{.*}}/LLVMgold.{{dll|dylib|so}}"
// CHECK-X86-64-COREI7: "-plugin-opt=mcpu=corei7"
// CHECK-X86-64-COREI7: "-plugin-opt=O3"
// CHECK-X86-64-COREI7: "-plugin-opt=foo"
@@ -18,11 +18,11 @@
// RUN: %clang -target arm-unknown-linux -### %t.o -flto 2>&1 \
// RUN: -march=armv7a -Wl,-plugin-opt=foo -O0 \
// RUN: | FileCheck %s --check-prefix=CHECK-ARM-V7A
-// CHECK-ARM-V7A: "-plugin" "{{.*}}/LLVMgold.so"
+// CHECK-ARM-V7A: "-plugin" "{{.*}}/LLVMgold.{{dll|dylib|so}}"
// CHECK-ARM-V7A: "-plugin-opt=mcpu=generic"
// CHECK-ARM-V7A: "-plugin-opt=O0"
// CHECK-ARM-V7A: "-plugin-opt=foo"
//
// RUN: %clang -target i686-linux-android -### %t.o -flto 2>&1 \
// RUN: | FileCheck %s --check-prefix=CHECK-X86-ANDROID
-// CHECK-X86-ANDROID: "-plugin" "{{.*}}/LLVMgold.so"
+// CHECK-X86-ANDROID: "-plugin" "{{.*}}/LLVMgold.{{dll|dylib|so}}"
diff --git a/clang/test/Driver/lto-plugin-darwin.c b/clang/test/Driver/lto-plugin-darwin.c
new file mode 100644
index 00000000000..db21f999ba2
--- /dev/null
+++ b/clang/test/Driver/lto-plugin-darwin.c
@@ -0,0 +1,6 @@
+// Check that Darwin uses LLVMgold.dylib.
+// REQUIRES: system-darwin
+// RUN: %clang -### %s -flto 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-LTO-PLUGIN %s
+//
+// CHECK-LTO-PLUGIN: "-plugin" "{{.*}}/LLVMgold.dylib"
diff --git a/clang/test/Driver/lto-plugin-linux.c b/clang/test/Driver/lto-plugin-linux.c
new file mode 100644
index 00000000000..e30dce6b055
--- /dev/null
+++ b/clang/test/Driver/lto-plugin-linux.c
@@ -0,0 +1,6 @@
+// Check that non-Windows, non-Darwin OSs use LLVMgold.so.
+// REQUIRES: !system-darwin && !system-windows
+// RUN: %clang -### %s -flto 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-LTO-PLUGIN %s
+//
+// CHECK-LTO-PLUGIN: "-plugin" "{{.*}}/LLVMgold.so"
diff --git a/clang/test/Driver/lto-plugin-windows.c b/clang/test/Driver/lto-plugin-windows.c
new file mode 100644
index 00000000000..2093e6a6cee
--- /dev/null
+++ b/clang/test/Driver/lto-plugin-windows.c
@@ -0,0 +1,6 @@
+// Check that Windows uses LLVMgold.dll.
+// REQUIRES: system-windows
+// RUN: %clang -### %s -flto 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-LTO-PLUGIN %s
+//
+// CHECK-LTO-PLUGIN: "-plugin" "{{.*}}/LLVMgold.dll"
diff --git a/clang/test/Driver/lto.c b/clang/test/Driver/lto.c
index d2f68f571af..20afd14eb88 100644
--- a/clang/test/Driver/lto.c
+++ b/clang/test/Driver/lto.c
@@ -36,19 +36,19 @@
// RUN: %clang -target x86_64-unknown-linux -### %s -flto 2> %t
// RUN: FileCheck -check-prefix=CHECK-LINK-LTO-ACTION < %t %s
//
-// CHECK-LINK-LTO-ACTION: "-plugin" "{{.*}}/LLVMgold.so"
+// CHECK-LINK-LTO-ACTION: "-plugin" "{{.*}}/LLVMgold.{{dll|dylib|so}}"
// -flto=full should cause link using gold plugin
// RUN: %clang -target x86_64-unknown-linux -### %s -flto=full 2> %t
// RUN: FileCheck -check-prefix=CHECK-LINK-FULL-ACTION < %t %s
//
-// CHECK-LINK-FULL-ACTION: "-plugin" "{{.*}}/LLVMgold.so"
+// CHECK-LINK-FULL-ACTION: "-plugin" "{{.*}}/LLVMgold.{{dll|dylib|so}}"
// Check that subsequent -fno-lto takes precedence
// RUN: %clang -target x86_64-unknown-linux -### %s -flto=full -fno-lto 2> %t
// RUN: FileCheck -check-prefix=CHECK-LINK-NOLTO-ACTION < %t %s
//
-// CHECK-LINK-NOLTO-ACTION-NOT: "-plugin" "{{.*}}/LLVMgold.so"
+// CHECK-LINK-NOLTO-ACTION-NOT: "-plugin" "{{.*}}/LLVMgold.{{dll|dylib|so}}"
// -flto passes along an explicit debugger tuning argument.
// RUN: %clang -target x86_64-unknown-linux -### %s -flto -glldb 2> %t
diff --git a/clang/test/Driver/thinlto.c b/clang/test/Driver/thinlto.c
index 0369b78be0f..d529f9bc322 100644
--- a/clang/test/Driver/thinlto.c
+++ b/clang/test/Driver/thinlto.c
@@ -19,19 +19,19 @@
// RUN: %clang -target x86_64-unknown-linux -### %s -flto=full -fno-lto -flto=thin 2> %t
// RUN: FileCheck -check-prefix=CHECK-LINK-THIN-ACTION < %t %s
//
-// CHECK-LINK-THIN-ACTION: "-plugin" "{{.*}}/LLVMgold.so"
+// CHECK-LINK-THIN-ACTION: "-plugin" "{{.*}}/LLVMgold.{{dll|dylib|so}}"
// CHECK-LINK-THIN-ACTION: "-plugin-opt=thinlto"
// Check that subsequent -flto=full takes precedence
// RUN: %clang -target x86_64-unknown-linux -### %s -flto=thin -flto=full 2> %t
// RUN: FileCheck -check-prefix=CHECK-LINK-FULL-ACTION < %t %s
//
-// CHECK-LINK-FULL-ACTION: "-plugin" "{{.*}}/LLVMgold.so"
+// CHECK-LINK-FULL-ACTION: "-plugin" "{{.*}}/LLVMgold.{{dll|dylib|so}}"
// CHECK-LINK-FULL-ACTION-NOT: "-plugin-opt=thinlto"
// Check that subsequent -fno-lto takes precedence
// RUN: %clang -target x86_64-unknown-linux -### %s -flto=thin -fno-lto 2> %t
// RUN: FileCheck -check-prefix=CHECK-LINK-NOLTO-ACTION < %t %s
//
-// CHECK-LINK-NOLTO-ACTION-NOT: "-plugin" "{{.*}}/LLVMgold.so"
+// CHECK-LINK-NOLTO-ACTION-NOT: "-plugin" "{{.*}}/LLVMgold.{{dll|dylib|so}}"
// CHECK-LINK-NOLTO-ACTION-NOT: "-plugin-opt=thinlto"
OpenPOWER on IntegriCloud