r356479 - [OpenCL] Minor improvements in default header testing
Anastasia Stulova via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 19 10:09:07 PDT 2019
Author: stulova
Date: Tue Mar 19 10:09:06 2019
New Revision: 356479
URL: http://llvm.org/viewvc/llvm-project?rev=356479&view=rev
Log:
[OpenCL] Minor improvements in default header testing
Differential Revision: https://reviews.llvm.org/D59544
Modified:
cfe/trunk/test/Headers/opencl-c-header.cl
Modified: cfe/trunk/test/Headers/opencl-c-header.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/opencl-c-header.cl?rev=356479&r1=356478&r2=356479&view=diff
==============================================================================
--- cfe/trunk/test/Headers/opencl-c-header.cl (original)
+++ cfe/trunk/test/Headers/opencl-c-header.cl Tue Mar 19 10:09:06 2019
@@ -53,15 +53,14 @@
// CHECK: _Z16convert_char_rtec
// CHECK-NOT: _Z3ctzc
// CHECK20: _Z3ctzc
-// CHECK20-NOT: _Z16convert_char_rtec
+// CHECK20: _Z16convert_char_rtec
char f(char x) {
-#if !defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ != CL_VERSION_2_0)
- return convert_char_rte(x);
-
-#else //__OPENCL_C_VERSION__
+// Check functionality from OpenCL 2.0 onwards
+#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ == CL_VERSION_2_0)
ndrange_t t;
- return ctz(x);
+ x = ctz(x);
#endif //__OPENCL_C_VERSION__
+ return convert_char_rte(x);
}
// Verify that a builtin using a write_only image3d_t type is available
More information about the cfe-commits
mailing list