// RUN: %clang_cc1 %s -emit-llvm -o - -triple spir-unknown-unknown | FileCheck %s
// RUN: %clang_cc1 %s -emit-llvm -o - -triple x86_64-pc-win32 | FileCheck %s
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
half test;
x+=2.0f;
x-=2.0f;
half y = x + x;
half z = y * 1.0f;
return z;
// CHECK: half 0xH3260
}
// CHECK-LABEL: @test_inc
// CHECK: [[INC:%.*]] = fadd half %x, 0xH3C00
// CHECK: ret half [[INC]]
half test_inc
{
return ++x;
}
__attribute__ int min;
__attribute__ half min;
__attribute__ float min;
__kernel void foo
{
buf[0] = min;
// CHECK: half noundef 0xH3E00
buf[0] = min;
// CHECK: float noundef 1.500000e+00
const half one = 1.6666;
buf[1] = min;
// CHECK: half noundef 0xH3EAB
}
{
half x = 0.1f