bolt/deps/llvm-18.1.8/clang/test/SemaOpenCLCXX/half.clcpp
2025-02-14 19:21:04 +01:00

15 lines
537 B
Text

//RUN: %clang_cc1 %s -triple spir -verify -fsyntax-only
#pragma OPENCL EXTENSION cl_khr_fp16 : disable
typedef half half2 __attribute__((ext_vector_type(2)));
half f(half2 h2) { // expected-error{{declaring function return value of type 'half' is not allowed ; did you forget * ?}}
return h2.s0; // expected-error{{loading directly from pointer to type '__private half' requires cl_khr_fp16. Use vector data load builtin functions instead}}
}
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
half f(half2 h2) {
return h2.s0;
}