summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2016-01-08 03:33:04 +0000
committerJustin Lebar <jlebar@google.com>2016-01-08 03:33:04 +0000
commit652b97bcf7eb2c7d0ac118401581ff131051b65d (patch)
tree206267e0a23fa7acef24b9701d8a86f995655db9 /clang/test
parent885260e480d929b90e1a2e8c67db4904807cb1ba (diff)
downloadbcm5719-llvm-652b97bcf7eb2c7d0ac118401581ff131051b65d.tar.gz
bcm5719-llvm-652b97bcf7eb2c7d0ac118401581ff131051b65d.zip
[CUDA] Split out tests for unused-arg warnings from cuda-options.cu.
Summary: Trying to make this test a bit more manageable. Reviewers: tra Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15974 llvm-svn: 257142
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Driver/cuda-options.cu18
-rw-r--r--clang/test/Driver/cuda-unused-arg-warning.cu23
2 files changed, 23 insertions, 18 deletions
diff --git a/clang/test/Driver/cuda-options.cu b/clang/test/Driver/cuda-options.cu
index 21625259d3e..53a8bfb1eea 100644
--- a/clang/test/Driver/cuda-options.cu
+++ b/clang/test/Driver/cuda-options.cu
@@ -111,20 +111,6 @@
// Make sure we don't link anything.
// RUN: -check-prefix CUDA-NL %s
-// --cuda-host-only should never trigger unused arg warning.
-// RUN: %clang -### -target x86_64-linux-gnu --cuda-host-only -c %s 2>&1 | \
-// RUN: FileCheck -check-prefix CUDA-NO-UNUSED-CHO %s
-// RUN: %clang -### -target x86_64-linux-gnu --cuda-host-only -x c -c %s 2>&1 | \
-// RUN: FileCheck -check-prefix CUDA-NO-UNUSED-CHO %s
-
-// --cuda-device-only should not produce warning compiling CUDA files
-// RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only -c %s 2>&1 | \
-// RUN: FileCheck -check-prefix CUDA-NO-UNUSED-CDO %s
-
-// --cuda-device-only should warn during non-CUDA compilation.
-// RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only -x c -c %s 2>&1 | \
-// RUN: FileCheck -check-prefix CUDA-UNUSED-CDO %s
-
// Match device-side preprocessor, and compiler phases with -save-temps
// CUDA-D1S: "-cc1" "-triple" "nvptx64-nvidia-cuda"
// CUDA-D1S-SAME: "-aux-triple" "x86_64--linux-gnu"
@@ -189,7 +175,3 @@
// Match no linker
// CUDA-NL-NOT: "{{.*}}{{ld|link}}{{(.exe)?}}"
-
-// CUDA-NO-UNUSED-CHO-NOT: warning: argument unused during compilation: '--cuda-host-only'
-// CUDA-UNUSED-CDO: warning: argument unused during compilation: '--cuda-device-only'
-// CUDA-NO-UNUSED-CDO-NOT: warning: argument unused during compilation: '--cuda-device-only'
diff --git a/clang/test/Driver/cuda-unused-arg-warning.cu b/clang/test/Driver/cuda-unused-arg-warning.cu
new file mode 100644
index 00000000000..76db3ef68f4
--- /dev/null
+++ b/clang/test/Driver/cuda-unused-arg-warning.cu
@@ -0,0 +1,23 @@
+// Tests that we trigger unused-arg warnings on CUDA flags appropriately.
+
+// REQUIRES: clang-driver
+// REQUIRES: x86-registered-target
+// REQUIRES: nvptx-registered-target
+
+// --cuda-host-only should never trigger unused arg warning.
+// RUN: %clang -### -target x86_64-linux-gnu --cuda-host-only -c %s 2>&1 | \
+// RUN: FileCheck %s
+// RUN: %clang -### -target x86_64-linux-gnu --cuda-host-only -x c -c %s 2>&1 | \
+// RUN: FileCheck %s
+
+// --cuda-device-only should warn during non-CUDA compilation.
+// RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only -x c -c %s 2>&1 | \
+// RUN: FileCheck -check-prefix UNUSED-CDO %s
+
+// --cuda-device-only should not produce warning compiling CUDA files
+// RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only -c %s 2>&1 | \
+// RUN: FileCheck -check-prefix NO-UNUSED-CDO %s
+
+// CHECK-NOT: warning: argument unused during compilation: '--cuda-host-only'
+// UNUSED-CDO: warning: argument unused during compilation: '--cuda-device-only'
+// NO-UNUSED-CDO-NOT: warning: argument unused during compilation: '--cuda-device-only'
OpenPOWER on IntegriCloud