diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2019-02-22 20:36:10 +0000 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-02-22 20:36:10 +0000 |
| commit | e69f94e02224de809d52b9a6fe58622b29e328c0 (patch) | |
| tree | f06d0f09040fff4c081c23e43d4a273ca66653b1 /clang/test | |
| parent | ffe1cf5e9283cbef9eab624ebab7b615cebb9ec0 (diff) | |
| download | bcm5719-llvm-e69f94e02224de809d52b9a6fe58622b29e328c0.tar.gz bcm5719-llvm-e69f94e02224de809d52b9a6fe58622b29e328c0.zip | |
[OPENMP] Delayed diagnostics for VLA support.
Generalized processing of the deferred diagnostics for OpenMP/CUDA code.
llvm-svn: 354690
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/OpenMP/target_vla_messages.cpp | 5 | ||||
| -rw-r--r-- | clang/test/SemaCUDA/vla.cu | 11 |
2 files changed, 13 insertions, 3 deletions
diff --git a/clang/test/OpenMP/target_vla_messages.cpp b/clang/test/OpenMP/target_vla_messages.cpp index b744081e983..30a27517242 100644 --- a/clang/test/OpenMP/target_vla_messages.cpp +++ b/clang/test/OpenMP/target_vla_messages.cpp @@ -47,7 +47,7 @@ void target_template(int arg) { #pragma omp target { #ifdef NO_VLA - // expected-error@+2 {{variable length arrays are not supported for the current target}} + // expected-error@+2 2 {{variable length arrays are not supported for the current target}} #endif T vla[arg]; } @@ -73,6 +73,9 @@ void target(int arg) { } } +#ifdef NO_VLA + // expected-note@+2 {{in instantiation of function template specialization 'target_template<long>' requested here}} +#endif target_template<long>(arg); } diff --git a/clang/test/SemaCUDA/vla.cu b/clang/test/SemaCUDA/vla.cu index b65ae5e5fe2..cf3054cd8e9 100644 --- a/clang/test/SemaCUDA/vla.cu +++ b/clang/test/SemaCUDA/vla.cu @@ -1,5 +1,9 @@ // RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fcuda-is-device -verify %s -// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -verify -DHOST %s +// RUN: %clang_cc1 -triple x86_64-unknown-linux -verify -DHOST %s + +#ifndef __CUDA_ARCH__ +// expected-no-diagnostics +#endif #include "Inputs/cuda.h" @@ -8,7 +12,10 @@ void host(int n) { } __device__ void device(int n) { - int x[n]; // expected-error {{cannot use variable-length arrays in __device__ functions}} + int x[n]; +#ifdef __CUDA_ARCH__ + // expected-error@-2 {{cannot use variable-length arrays in __device__ functions}} +#endif } __host__ __device__ void hd(int n) { |

