Skip to content

Commit 652b97b

Browse files
author
Justin Lebar
committedJan 8, 2016
[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
1 parent 885260e commit 652b97b

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed
 

‎clang/test/Driver/cuda-options.cu

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -111,20 +111,6 @@
111111
// Make sure we don't link anything.
112112
// RUN: -check-prefix CUDA-NL %s
113113

114-
// --cuda-host-only should never trigger unused arg warning.
115-
// RUN: %clang -### -target x86_64-linux-gnu --cuda-host-only -c %s 2>&1 | \
116-
// RUN: FileCheck -check-prefix CUDA-NO-UNUSED-CHO %s
117-
// RUN: %clang -### -target x86_64-linux-gnu --cuda-host-only -x c -c %s 2>&1 | \
118-
// RUN: FileCheck -check-prefix CUDA-NO-UNUSED-CHO %s
119-
120-
// --cuda-device-only should not produce warning compiling CUDA files
121-
// RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only -c %s 2>&1 | \
122-
// RUN: FileCheck -check-prefix CUDA-NO-UNUSED-CDO %s
123-
124-
// --cuda-device-only should warn during non-CUDA compilation.
125-
// RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only -x c -c %s 2>&1 | \
126-
// RUN: FileCheck -check-prefix CUDA-UNUSED-CDO %s
127-
128114
// Match device-side preprocessor, and compiler phases with -save-temps
129115
// CUDA-D1S: "-cc1" "-triple" "nvptx64-nvidia-cuda"
130116
// CUDA-D1S-SAME: "-aux-triple" "x86_64--linux-gnu"
@@ -189,7 +175,3 @@
189175

190176
// Match no linker
191177
// CUDA-NL-NOT: "{{.*}}{{ld|link}}{{(.exe)?}}"
192-
193-
// CUDA-NO-UNUSED-CHO-NOT: warning: argument unused during compilation: '--cuda-host-only'
194-
// CUDA-UNUSED-CDO: warning: argument unused during compilation: '--cuda-device-only'
195-
// CUDA-NO-UNUSED-CDO-NOT: warning: argument unused during compilation: '--cuda-device-only'
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Tests that we trigger unused-arg warnings on CUDA flags appropriately.
2+
3+
// REQUIRES: clang-driver
4+
// REQUIRES: x86-registered-target
5+
// REQUIRES: nvptx-registered-target
6+
7+
// --cuda-host-only should never trigger unused arg warning.
8+
// RUN: %clang -### -target x86_64-linux-gnu --cuda-host-only -c %s 2>&1 | \
9+
// RUN: FileCheck %s
10+
// RUN: %clang -### -target x86_64-linux-gnu --cuda-host-only -x c -c %s 2>&1 | \
11+
// RUN: FileCheck %s
12+
13+
// --cuda-device-only should warn during non-CUDA compilation.
14+
// RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only -x c -c %s 2>&1 | \
15+
// RUN: FileCheck -check-prefix UNUSED-CDO %s
16+
17+
// --cuda-device-only should not produce warning compiling CUDA files
18+
// RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only -c %s 2>&1 | \
19+
// RUN: FileCheck -check-prefix NO-UNUSED-CDO %s
20+
21+
// CHECK-NOT: warning: argument unused during compilation: '--cuda-host-only'
22+
// UNUSED-CDO: warning: argument unused during compilation: '--cuda-device-only'
23+
// NO-UNUSED-CDO-NOT: warning: argument unused during compilation: '--cuda-device-only'

0 commit comments

Comments
 (0)
Please sign in to comment.