[PATCH] D15974: [CUDA] Split out tests for unused-arg warnings from cuda-options.cu.

Justin Lebar via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 7 19:36:47 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL257142: [CUDA] Split out tests for unused-arg warnings from cuda-options.cu. (authored by jlebar).

Changed prior to commit:
  http://reviews.llvm.org/D15974?vs=44270&id=44309#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15974

Files:
  cfe/trunk/test/Driver/cuda-options.cu
  cfe/trunk/test/Driver/cuda-unused-arg-warning.cu

Index: cfe/trunk/test/Driver/cuda-options.cu
===================================================================
--- cfe/trunk/test/Driver/cuda-options.cu
+++ cfe/trunk/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'
Index: cfe/trunk/test/Driver/cuda-unused-arg-warning.cu
===================================================================
--- cfe/trunk/test/Driver/cuda-unused-arg-warning.cu
+++ cfe/trunk/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'


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15974.44309.patch
Type: text/x-patch
Size: 2955 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160108/ee5e4708/attachment.bin>


More information about the cfe-commits mailing list