blob: 41385c1177ca04d452dad3431c1e93d0bc6dbaa1 [file] [log] [blame]
Egor Churaev24939d42016-12-13 14:02:35 +00001//RUN: %clang_cc1 -O0 -cl-std=CL2.0 -fsyntax-only -verify %s
Anastasia Stulova6bdbcbb2016-02-19 18:30:11 +00002
Anastasia Stulova6bdbcbb2016-02-19 18:30:11 +00003kernel void C (global int *x) {
4 int I = 3;
5 __attribute__((opencl_unroll_hint(I))) // expected-error {{'opencl_unroll_hint' attribute requires an integer constant}}
6 while (I--);
7}
8
9kernel void E() {
10 __attribute__((opencl_unroll_hint(2,4))) // expected-error {{'opencl_unroll_hint' attribute takes no more than 1 argument}}
11 for(int i=0; i<100; i++);
12}
13
14kernel void F() {
15 __attribute__((opencl_unroll_hint(-1))) // expected-error {{'opencl_unroll_hint' attribute requires a positive integral compile time constant expression}}
16 for(int i=0; i<100; i++);
17}