1 //RUN
: %clang_cc1 -cl-std
=CL2.0 -fsyntax-only -verify %s
3 kernel void B
(global int
*x
) {
4 __attribute__
((opencl_unroll_hint(42))) // expected-error
{{'opencl_unroll_hint
' attribute only applies to
'for
', 'while
', and
'do
' statements
}}
9 void parse_order_error
() {
10 // Ensure we properly diagnose OpenCL loop attributes on the incorrect
11 // subject in the presence of other attributes.
13 __attribute__
((nomerge, opencl_unroll_hint
(8))) // expected-error
{{'opencl_unroll_hint
' attribute only applies to
'for
', 'while
', and
'do
' statements
}}
14 if
(i) { parse_order_error
(); } // Recursive call silences unrelated diagnostic about nomerge.
16 __attribute__
((opencl_unroll_hint(8), nomerge
)) // expected-error
{{'opencl_unroll_hint
' attribute only applies to
'for
', 'while
', and
'do
' statements
}}
17 if
(i) { parse_order_error
(); } // Recursive call silences unrelated diagnostic about nomerge.
19 __attribute__
((nomerge, opencl_unroll_hint
(8))) // OK
20 while
(1) { parse_order_error
(); } // Recursive call silences unrelated diagnostic about nomerge.