diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2019-02-22 16:49:13 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-02-22 16:49:13 +0000 |
commit | 6bd887f482ae1b3fd74f7c949aab7a3888fefe03 (patch) | |
tree | 8d643c71d2eddbcd3829876751e1d0ba5ebe6595 /test/SemaCUDA | |
parent | 8f37e96206e47808d516401da00e100a960f66aa (diff) | |
download | clang-6bd887f482ae1b3fd74f7c949aab7a3888fefe03.tar.gz |
[OPENMP] Delayed diagnostics for VLA support.
Generalized processing of the deferred diagnostics for OpenMP/CUDA code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354679 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCUDA')
-rw-r--r-- | test/SemaCUDA/vla.cu | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/SemaCUDA/vla.cu b/test/SemaCUDA/vla.cu index b65ae5e5fe..cf3054cd8e 100644 --- a/test/SemaCUDA/vla.cu +++ b/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) { |