warn-cuda-compat.cu 470 B

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