summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorAlexey Sotkin <alexey.sotkin@intel.com>2018-09-03 11:43:22 +0000
committerAlexey Sotkin <alexey.sotkin@intel.com>2018-09-03 11:43:22 +0000
commit73ae7cb4f12fb939a52fa16b12baa8afa48821cc (patch)
tree7f8f7923203b022cf4f7c8801be93f26e23a0175 /clang/test
parente9e38c207e463b3806754b4eb7d836181c58a399 (diff)
downloadbcm5719-llvm-73ae7cb4f12fb939a52fa16b12baa8afa48821cc.tar.gz
bcm5719-llvm-73ae7cb4f12fb939a52fa16b12baa8afa48821cc.zip
[OpenCL] Traverse vector types for ocl extensions support
Summary: Given the following kernel: __kernel void foo() { double d; double4 dd; } and cl_khr_fp64 is disabled, the compilation would fail due to the presence of 'double d', but when removed, it passes. The expectation is that extended vector types of unsupported types will also be unsupported. The patch adds the check for this scenario. Patch by: Ofir Cohen Reviewers: bader, Anastasia, AlexeySotkin, yaxunl Reviewed By: Anastasia Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51296 llvm-svn: 341309
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaOpenCL/extensions.cl7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/SemaOpenCL/extensions.cl b/clang/test/SemaOpenCL/extensions.cl
index 6afb11e42a6..5f95e32d4a5 100644
--- a/clang/test/SemaOpenCL/extensions.cl
+++ b/clang/test/SemaOpenCL/extensions.cl
@@ -70,6 +70,13 @@ void f2(void) {
// expected-error@-2{{use of type 'double' requires cl_khr_fp64 extension to be enabled}}
#endif
+ typedef double double4 __attribute__((ext_vector_type(4)));
+ double4 d4 = {0.0f, 2.0f, 3.0f, 1.0f};
+#ifdef NOFP64
+// expected-error@-3 {{use of type 'double' requires cl_khr_fp64 extension to be enabled}}
+// expected-error@-3 {{use of type 'double4' (vector of 4 'double' values) requires cl_khr_fp64 extension to be enabled}}
+#endif
+
(void) 1.0;
#ifdef NOFP64
OpenPOWER on IntegriCloud