summaryrefslogtreecommitdiff
path: root/test/CodeGenOpenCL/half.cl
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-29 16:25:46 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-29 16:25:46 +0000
commitb5aee35cc5d62f11d98539f62e4fe63f0ac9edc6 (patch)
tree3e6ab962dbc73cfe1445a60d2eb4dfba7c939a22 /test/CodeGenOpenCL/half.cl
parentaa803409c3bd3930126db630c29f63d42f255153 (diff)
Notes
Diffstat (limited to 'test/CodeGenOpenCL/half.cl')
-rw-r--r--test/CodeGenOpenCL/half.cl17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeGenOpenCL/half.cl b/test/CodeGenOpenCL/half.cl
index 9acabf0a2a83..a10ba4d7f9e9 100644
--- a/test/CodeGenOpenCL/half.cl
+++ b/test/CodeGenOpenCL/half.cl
@@ -21,3 +21,20 @@ half test_inc(half x)
{
return ++x;
}
+
+__attribute__((overloadable)) int min(int, int);
+__attribute__((overloadable)) half min(half, half);
+__attribute__((overloadable)) float min(float, float);
+
+__kernel void foo( __global half* buf, __global float* buf2 )
+{
+ buf[0] = min( buf[0], 1.5h );
+// CHECK: half 0xH3E00
+ buf[0] = min( buf2[0], 1.5f );
+// CHECK: float 1.500000e+00
+
+ const half one = 1.6666;
+ buf[1] = min( buf[1], one );
+// CHECK: half 0xH3EAB
+}
+