// RUN: %clang_cc1 -emit-llvm -o - -triple x86_64-darwin-apple %s | FileCheck %s
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
// CHECK-LABEL: define{{.*}} void @test_half_builtins
void test_half_builtins;
// CHECK: call half @llvm.copysign.f16
res = __builtin_copysignf16;
// CHECK: call half @llvm.fabs.f16
res = __builtin_fabsf16;
// CHECK: call half @llvm.ceil.f16
res = __builtin_ceilf16;
// CHECK: call half @llvm.cos.f16
res = __builtin_cosf16;
// CHECK: call half @llvm.exp.f16
res = __builtin_expf16;
// CHECK: call half @llvm.exp2.f16
res = __builtin_exp2f16;
// CHECK: call half @llvm.floor.f16
res = __builtin_floorf16;
// CHECK: call half @llvm.fma.f16
res = __builtin_fmaf16;
// CHECK: call half @llvm.maxnum.f16
res = __builtin_fmaxf16;
// CHECK: call half @llvm.minnum.f16
res = __builtin_fminf16;
// CHECK: frem half %h0, %h1
res = __builtin_fmodf16;
// CHECK: call half @llvm.pow.f16
res = __builtin_powf16;
// CHECK: call half @llvm.log10.f16
res = __builtin_log10f16;
// CHECK: call half @llvm.log2.f16
res = __builtin_log2f16;
// CHECK: call half @llvm.log.f16
res = __builtin_logf16;
// CHECK: call half @llvm.rint.f16
res = __builtin_rintf16;
// CHECK: call half @llvm.round.f16
res = __builtin_roundf16;
// CHECK: call half @llvm.sin.f16
res = __builtin_sinf16;
// CHECK: call half @llvm.sqrt.f16
res = __builtin_sqrtf16;
// CHECK: call half @llvm.trunc.f16
res = __builtin_truncf16;
// CHECK: call half @llvm.canonicalize.f16
res = __builtin_canonicalizef16;
}
{
volatile half res