Egor Churaev | 24939d4 | 2016-12-13 14:02:35 +0000 | [diff] [blame] | 1 | //RUN: %clang_cc1 -O0 -cl-std=CL2.0 -fsyntax-only -verify %s |
Anastasia Stulova | 6bdbcbb | 2016-02-19 18:30:11 +0000 | [diff] [blame] | 2 | |
Anastasia Stulova | 6bdbcbb | 2016-02-19 18:30:11 +0000 | [diff] [blame] | 3 | kernel 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 | |
| 9 | kernel 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 | |
| 14 | kernel 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 | } |