[PATCH] D35000: [OpenCL] Added extended tests on metadata generation for half data type and arrays.

Egor Churaev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 5 02:05:24 PDT 2017


echuraev created this revision.
Herald added a subscriber: yaxunl.

https://reviews.llvm.org/D35000

Files:
  test/CodeGenOpenCL/kernel-arg-info.cl


Index: test/CodeGenOpenCL/kernel-arg-info.cl
===================================================================
--- test/CodeGenOpenCL/kernel-arg-info.cl
+++ test/CodeGenOpenCL/kernel-arg-info.cl
@@ -61,6 +61,37 @@
 // CHECK-NOT: !kernel_arg_name
 // ARGINFO: !kernel_arg_name ![[MD54:[0-9]+]]
 
+kernel void foo6(constant half*constanthalfp,
+                 constant half *restrict constanthalfrestrictp,
+                 global half*globalhalfp,
+                 global half *restrict globalhalfrestrictp,
+                 global const half* globalconsthalfp,
+                 global const half * restrict globalconsthalfrestrictp,
+
+                 global volatile half*globalvolatilehalfp,
+                 global volatile half *restrict globalvolatilehalfrestrictp,
+                 global const volatile half* globalconstvolatilehalfp)
+{}
+// CHECK: !kernel_arg_type ![[MD61:[0-9]+]]
+// CHECK: !kernel_arg_base_type ![[MD61]]
+
+kernel void foo6_2(global const volatile half * restrict globalconstvolatilehalfrestrictp,
+                   local half*localhalfp,
+                   local half *restrict localhalfrestrictp,
+                   local const half* localconsthalfp,
+                   local const half * restrict localconsthalfrestrictp,
+                   local volatile half*localvolatilehalfp,
+                   local volatile half *restrict localvolatilehalfrestrictp,
+                   local const volatile half* localconstvolatilehalfp,
+                   local const volatile half * restrict localconstvolatilehalfrestrictp)
+{}
+// CHECK: !kernel_arg_type ![[MD61]]
+// CHECK: !kernel_arg_base_type ![[MD61]]
+
+typedef char char16 __attribute__((ext_vector_type(16)));
+__kernel void foo7(__global char16 arg[]) {}
+// CHECK: !kernel_arg_type ![[MD71:[0-9]+]]
+
 // CHECK: ![[MD11]] = !{i32 1, i32 0, i32 0, i32 2, i32 1, i32 1}
 // CHECK: ![[MD12]] = !{!"none", !"none", !"none", !"none", !"none", !"none"}
 // CHECK: ![[MD13]] = !{!"int*", !"int", !"int", !"float*", !"int*", !"int*"}
@@ -86,4 +117,6 @@
 // CHECK: ![[MD52]] = !{!"myImage", !"image1d_t"}
 // CHECK: ![[MD53]] = !{!"image1d_t", !"image1d_t"}
 // ARGINFO: ![[MD54]] = !{!"img1", !"img2"}
+// CHECK: ![[MD61]] = !{!"half*", !"half*", !"half*", !"half*", !"half*", !"half*", !"half*", !"half*", !"half*"}
+// CHECK: ![[MD71]] = !{!"char16*"}
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35000.105230.patch
Type: text/x-patch
Size: 2357 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170705/8eb954d3/attachment-0001.bin>


More information about the cfe-commits mailing list