1 // RUN
: %clang_cc1 %s -verify -pedantic -fsyntax-only -Wno-unused-value
3 #pragma OPENCL EXTENSION cl_khr_fp16
: disable
5 half half_disabled
(half *p
, // expected-error
{{declaring function return value of type
'half
' is not allowed
}}
6 half h
) // expected-error
{{declaring function parameter of type
'half
' is not allowed
}}
8 half a
[2]; // expected-error{{declaring variable of type 'half [2]' is not allowed
}}
9 half b
; // expected-error{{declaring variable of type 'half' is not allowed}}
10 *p
; // expected-error{{loading directly from pointer to type 'half' is not allowed}}
11 p
[1]; // expected-error{{loading directly from pointer to type 'half' is not allowed}}
14 b = (half) c; // expected-error{{casting to type 'half' is not allowed}}
16 half *allowed = &p[1];
18 half
*allowed3
= p
+ 1;
23 // Exactly the same as above but with the cl_khr_fp16 extension enabled.
24 #pragma OPENCL EXTENSION cl_khr_fp16
: enable
25 half half_enabled
(half *p
, half h
)
35 half *allowed = &p[1];
37 half *allowed3 = p + 1;