diff options
Diffstat (limited to 'test/Parser/warn-cuda-compat.cu')
-rw-r--r-- | test/Parser/warn-cuda-compat.cu | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Parser/warn-cuda-compat.cu b/test/Parser/warn-cuda-compat.cu new file mode 100644 index 0000000000..c3aad6f663 --- /dev/null +++ b/test/Parser/warn-cuda-compat.cu @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -Wno-cuda-compat -Werror %s +// RUN: %clang_cc1 -Wcuda-compat -verify %s +// RUN: %clang_cc1 -x c++ -Wcuda-compat -Werror %s + +// Note that this puts the expected lines before the directives to work around +// limitations in the -verify mode. + +void test(int *List, int Length) { +/* expected-warning {{argument to '#pragma unroll' should not be in parentheses in CUDA C/C++}} */#pragma unroll(4) + for (int i = 0; i < Length; ++i) { + List[i] = i; + } +} |