summaryrefslogtreecommitdiffstats
path: root/clang/test/Driver
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-04-18 23:12:59 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-04-18 23:12:59 +0000
commitcceb468f367b5af5ba60de7ec257c7d57f8d9c8e (patch)
tree0b8d273cb3aab95d6965a2da40d426ea51289120 /clang/test/Driver
parentebb932d0607bd79fa63e0eddd2e014243e756949 (diff)
downloadbcm5719-llvm-cceb468f367b5af5ba60de7ec257c7d57f8d9c8e.tar.gz
bcm5719-llvm-cceb468f367b5af5ba60de7ec257c7d57f8d9c8e.zip
Mark -Xclang as being a compilation-only option so that the clang driver
doesn't warn if it's passed to a link action. This matches the behavior for most other compilation-only options (including things like -f flags), and is necessary to suppress warnings on systems like cmake that always pass all compile flags to the linker. llvm-svn: 266695
Diffstat (limited to 'clang/test/Driver')
-rw-r--r--clang/test/Driver/linker-opts.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/Driver/linker-opts.c b/clang/test/Driver/linker-opts.c
index 24866a63b1f..29ef136c8b7 100644
--- a/clang/test/Driver/linker-opts.c
+++ b/clang/test/Driver/linker-opts.c
@@ -1,3 +1,6 @@
+// RUN: rm -rf %t
+// RUN: mkdir %t
+//
// RUN: env LIBRARY_PATH=%T/test1 %clang -x c %s -### 2>&1 | FileCheck %s
// CHECK: "-L{{.*}}/test1"
@@ -9,3 +12,12 @@
// Make sure that LIBRARY_PATH works for both i386 and x86_64 on Darwin.
// RUN: env LIBRARY_PATH=%T/test1 %clang -target x86_64-apple-darwin %s -### 2>&1 | FileCheck %s
// RUN: env LIBRARY_PATH=%T/test1 %clang -target i386-apple-darwin %s -### 2>&1 | FileCheck %s
+//
+// Make sure that we don't warn on unused compiler arguments.
+// RUN: %clang -Xclang -I. -x c %s -c -o %t/tmp.o
+// RUN: %clang -Xclang -I. %t/tmp.o -o %t/tmp -### 2>&1 | FileCheck %s --check-prefix=NO-UNUSED
+// NO-UNUSED-NOT: warning:{{.*}}unused
+//
+// Make sure that we do warn in other cases.
+// RUN: %clang %s -lfoo -c -o %t/tmp2.o -### 2>&1 | FileCheck %s --check-prefix=UNUSED
+// UNUSED: warning:{{.*}}unused
OpenPOWER on IntegriCloud