1 // RUN
: %clang_cc1 %s -emit-llvm -o - -triple spir-unknown-unknown | FileCheck %s
2 // RUN
: %clang_cc1 %s -emit-llvm -o - -triple x86_64-pc-win32 | FileCheck %s
4 #pragma OPENCL EXTENSION cl_khr_fp16
: enable
15 // CHECK
: half
0xH3260
18 // CHECK-LABEL
: @test_inc
(half noundef %x
)
19 // CHECK
: [[INC
:%.
*]] = fadd half %x
, 0xH3C00
20 // CHECK
: ret half
[[INC]]
26 __attribute__((overloadable)) int min(int, int);
27 __attribute__((overloadable)) half min(half, half);
28 __attribute__((overloadable)) float min(float, float);
30 __kernel void foo( __global half* buf, __global float* buf2 )
32 buf[0] = min( buf[0], 1.5h );
33 // CHECK: half noundef 0xH3E00
34 buf[0] = min( buf2[0], 1.5f );
35 // CHECK: float noundef 1.500000e+00
37 const half one = 1.6666;
38 buf[1] = min( buf[1], one );
39 // CHECK: half noundef 0xH3EAB