xref: /minix3/external/bsd/llvm/dist/clang/test/Parser/warn-cuda-compat.cu (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -Wno-cuda-compat -Werror %s
2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -Wcuda-compat -verify %s
3*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -x c++ -Wcuda-compat -Werror %s
4*0a6a1f1dSLionel Sambuc 
5*0a6a1f1dSLionel Sambuc // Note that this puts the expected lines before the directives to work around
6*0a6a1f1dSLionel Sambuc // limitations in the -verify mode.
7*0a6a1f1dSLionel Sambuc 
test(int * List,int Length)8*0a6a1f1dSLionel Sambuc void test(int *List, int Length) {
9*0a6a1f1dSLionel Sambuc /* expected-warning {{argument to '#pragma unroll' should not be in parentheses in CUDA C/C++}} */#pragma unroll(4)
10*0a6a1f1dSLionel Sambuc   for (int i = 0; i < Length; ++i) {
11*0a6a1f1dSLionel Sambuc     List[i] = i;
12*0a6a1f1dSLionel Sambuc   }
13*0a6a1f1dSLionel Sambuc }
14