[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Parser / opencl-unroll-hint.cl
blobadfe18d9967233de824dcc6e43a91899d94330a3
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}}
5 if (x[0])
6 x[0] = 15;
9 void parse_order_error() {
10 // Ensure we properly diagnose OpenCL loop attributes on the incorrect
11 // subject in the presence of other attributes.
12 int i = 1000;
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.