aboutsummaryrefslogtreecommitdiff
path: root/test/Headers
diff options
context:
space:
mode:
authorAnastasia Stulova <anastasia.stulova@arm.com>2019-03-19 13:04:17 +0000
committerAnastasia Stulova <anastasia.stulova@arm.com>2019-03-19 13:04:17 +0000
commit03da18856a7340f59d3f9c33bab36bf44665f787 (patch)
tree37467c80baeb077426fcee4410659fbd4a59203f /test/Headers
parent6e5c5ff2d98f297fcfbb107f00010b792c4a8b14 (diff)
[OpenCL] Improved testing of default header.
Improved some checks and moved testing of the default header in C++ mode into the Headers folder. Differential Revision: https://reviews.llvm.org/D59486 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356450 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Headers')
-rw-r--r--test/Headers/opencl-c-header.cl11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/Headers/opencl-c-header.cl b/test/Headers/opencl-c-header.cl
index b26e61bf1a..234508b9ff 100644
--- a/test/Headers/opencl-c-header.cl
+++ b/test/Headers/opencl-c-header.cl
@@ -1,6 +1,7 @@
// RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify | FileCheck %s
-// RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify -cl-std=CL1.1| FileCheck %s
-// RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify -cl-std=CL1.2| FileCheck %s
+// RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify -cl-std=CL1.1 | FileCheck %s
+// RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify -cl-std=CL1.2 | FileCheck %s
+// RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify -cl-std=c++ | FileCheck %s --check-prefix=CHECK20
// Test including the default header as a module.
// The module should be compiled only once and loaded from cache afterwards.
@@ -54,7 +55,7 @@
// CHECK20: _Z3ctzc
// CHECK20-NOT: _Z16convert_char_rtec
char f(char x) {
-#if __OPENCL_C_VERSION__ != CL_VERSION_2_0
+#if !defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ != CL_VERSION_2_0)
return convert_char_rte(x);
#else //__OPENCL_C_VERSION__
@@ -67,7 +68,7 @@ char f(char x) {
// from OpenCL 2.0 onwards.
// CHECK20: _Z12write_imagef14ocl_image3d_wo
-#if __OPENCL_C_VERSION__ >= CL_VERSION_2_0
+#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0)
void test_image3dwo(write_only image3d_t img) {
write_imagef(img, (0), (0.0f));
}
@@ -75,7 +76,7 @@ void test_image3dwo(write_only image3d_t img) {
// Verify that non-builtin cl_intel_planar_yuv extension is defined from
// OpenCL 1.2 onwards.
-#if (__OPENCL_C_VERSION__ >= CL_VERSION_1_2)
+#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_1_2)
// expected-no-diagnostics
#ifndef cl_intel_planar_yuv
#error "Missing cl_intel_planar_yuv define"