mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-27 15:28:53 -04:00

Add support for opencl_unroll_hint attribute from OpenCL v2.0 s6.11.5. Reusing most of metadata generation from CGLoopInfo helper class. The code is based on Khronos OpenCL compiler: https://github.com/KhronosGroup/SPIR/tree/spirv-1.0 Patch by Liu Yaxun (Sam)! Differential Revision: http://reviews.llvm.org/D16686 llvm-svn: 261350
9 lines
301 B
Common Lisp
9 lines
301 B
Common Lisp
//RUN: %clang_cc1 -O0 -cl-std=CL2.0 -fsyntax-only -verify %s
|
|
|
|
kernel void B (global int *x) {
|
|
__attribute__((opencl_unroll_hint(42)))
|
|
if (x[0]) // expected-error {{OpenCL only supports 'opencl_unroll_hint' attribute on for, while, and do statements}}
|
|
x[0] = 15;
|
|
}
|
|
|