[PATCH] D59544: [OpenCL] Minor improvements in default header testing

Phabricator via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 19 10:09:34 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL356479: [OpenCL] Minor improvements in default header testing (authored by stulova, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D59544?vs=191289&id=191341#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59544/new/

https://reviews.llvm.org/D59544

Files:
  cfe/trunk/test/Headers/opencl-c-header.cl


Index: cfe/trunk/test/Headers/opencl-c-header.cl
===================================================================
--- cfe/trunk/test/Headers/opencl-c-header.cl
+++ cfe/trunk/test/Headers/opencl-c-header.cl
@@ -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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59544.191341.patch
Type: text/x-patch
Size: 861 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190319/6f32c6ab/attachment.bin>


More information about the cfe-commits mailing list