Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CUDA] Reject values for --cuda-gpu-arch that are not of the form /sm…
…_\d+/. Reviewers: tra Subscribers: cfe-commits, jhen, echristo Differential Revision: http://reviews.llvm.org/D16079 llvm-svn: 257413
- Loading branch information
Justin Lebar
committed
Jan 11, 2016
1 parent
36a425b
commit 7bf7798
Showing
5 changed files
with
56 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Checks errors generated by passing a bad value for --cuda-gpu-arch. | ||
// REQUIRES: clang-driver | ||
// REQUIRES: x86-registered-target | ||
// REQUIRES: nvptx-registered-target | ||
|
||
// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=compute_20 -c %s 2>&1 \ | ||
// RUN: | FileCheck -check-prefix BAD %s | ||
// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=foo_20 -c %s 2>&1 \ | ||
// RUN: | FileCheck -check-prefix BAD %s | ||
// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm20 -c %s 2>&1 \ | ||
// RUN: | FileCheck -check-prefix BAD %s | ||
// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_abc -c %s 2>&1 \ | ||
// RUN: | FileCheck -check-prefix BAD %s | ||
// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_20a -c %s 2>&1 \ | ||
// RUN: | FileCheck -check-prefix BAD %s | ||
// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_a20 -c %s 2>&1 \ | ||
// RUN: | FileCheck -check-prefix BAD %s | ||
// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=ssm_20 -c %s 2>&1 \ | ||
// RUN: | FileCheck -check-prefix BAD %s | ||
// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_ -c %s 2>&1 \ | ||
// RUN: | FileCheck -check-prefix BAD %s | ||
|
||
// BAD: error: Unsupported CUDA gpu architecture | ||
|
||
// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_2 -c %s 2>&1 \ | ||
// RUN: | FileCheck -check-prefix OK %s | ||
// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 -c %s 2>&1 \ | ||
// RUN: | FileCheck -check-prefix OK %s | ||
// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_999 -c %s 2>&1 \ | ||
// RUN: | FileCheck -check-prefix OK %s | ||
// RUN: %clang -### -target x86_64-linux-gnu -c %s 2>&1 \ | ||
// RUN: | FileCheck -check-prefix OK %s | ||
|
||
// OK-NOT: error: Unsupported CUDA gpu architecture |