Anastasia Stulova | ae2e86f | 2018-09-24 14:21:56 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 %s -fblocks -verify -pedantic -fsyntax-only -ferror-limit 100 |
Anastasia Stulova | 7f8d6dc | 2016-07-04 16:07:18 +0000 | [diff] [blame] | 2 | |
| 3 | // Confirm CL2.0 Clang builtins are not available in earlier versions |
| 4 | |
| 5 | kernel void dse_builtins() { |
| 6 | int tmp; |
Egor Churaev | f59d921 | 2017-05-30 05:57:52 +0000 | [diff] [blame] | 7 | enqueue_kernel(tmp, tmp, tmp, ^(void) { // expected-error{{implicit declaration of function 'enqueue_kernel' is invalid in OpenCL}} |
Anastasia Stulova | 7f8d6dc | 2016-07-04 16:07:18 +0000 | [diff] [blame] | 8 | return; |
| 9 | }); |
Egor Churaev | f59d921 | 2017-05-30 05:57:52 +0000 | [diff] [blame] | 10 | unsigned size = get_kernel_work_group_size(^(void) { // expected-error{{implicit declaration of function 'get_kernel_work_group_size' is invalid in OpenCL}} |
Anastasia Stulova | 7f8d6dc | 2016-07-04 16:07:18 +0000 | [diff] [blame] | 11 | return; |
| 12 | }); |
Egor Churaev | f59d921 | 2017-05-30 05:57:52 +0000 | [diff] [blame] | 13 | size = get_kernel_preferred_work_group_size_multiple(^(void) { // expected-error{{implicit declaration of function 'get_kernel_preferred_work_group_size_multiple' is invalid in OpenCL}} |
Anastasia Stulova | 7f8d6dc | 2016-07-04 16:07:18 +0000 | [diff] [blame] | 14 | return; |
| 15 | }); |
| 16 | } |
| 17 | |
| 18 | void pipe_builtins() { |
| 19 | int tmp; |
| 20 | |
Egor Churaev | f59d921 | 2017-05-30 05:57:52 +0000 | [diff] [blame] | 21 | foo(void); // expected-error{{implicit declaration of function 'foo' is invalid in OpenCL}} |
| 22 | // expected-note@-1{{'foo' declared here}} |
| 23 | // expected-error@-2{{expected expression}} |
| 24 | boo(); // expected-error{{implicit declaration of function 'boo' is invalid in OpenCL}} |
| 25 | // expected-note@-1{{did you mean 'foo'?}} |
Anastasia Stulova | 7f8d6dc | 2016-07-04 16:07:18 +0000 | [diff] [blame] | 26 | |
Egor Churaev | f59d921 | 2017-05-30 05:57:52 +0000 | [diff] [blame] | 27 | read_pipe(tmp, tmp); // expected-error{{implicit declaration of function 'read_pipe' is invalid in OpenCL}} |
| 28 | write_pipe(tmp, tmp); // expected-error{{implicit declaration of function 'write_pipe' is invalid in OpenCL}} |
Anastasia Stulova | 7f8d6dc | 2016-07-04 16:07:18 +0000 | [diff] [blame] | 29 | |
Egor Churaev | f59d921 | 2017-05-30 05:57:52 +0000 | [diff] [blame] | 30 | reserve_read_pipe(tmp, tmp); // expected-error{{implicit declaration of function 'reserve_read_pipe' is invalid in OpenCL}} |
| 31 | // expected-note@-1{{'reserve_read_pipe' declared here}} |
| 32 | reserve_write_pipe(tmp, tmp); // expected-error{{implicit declaration of function 'reserve_write_pipe' is invalid in OpenCL}} |
| 33 | // expected-note@-1{{did you mean 'reserve_read_pipe'?}} |
Anastasia Stulova | 7f8d6dc | 2016-07-04 16:07:18 +0000 | [diff] [blame] | 34 | |
Egor Churaev | f59d921 | 2017-05-30 05:57:52 +0000 | [diff] [blame] | 35 | work_group_reserve_read_pipe(tmp, tmp); // expected-error{{implicit declaration of function 'work_group_reserve_read_pipe' is invalid in OpenCL}} |
| 36 | // expected-note@-1 2{{'work_group_reserve_read_pipe' declared here}} |
| 37 | work_group_reserve_write_pipe(tmp, tmp); // expected-error{{implicit declaration of function 'work_group_reserve_write_pipe' is invalid in OpenCL}} |
| 38 | // expected-note@-1{{did you mean 'work_group_reserve_read_pipe'?}} |
| 39 | // expected-note@-2{{'work_group_reserve_write_pipe' declared here}} |
Anastasia Stulova | 7f8d6dc | 2016-07-04 16:07:18 +0000 | [diff] [blame] | 40 | |
Egor Churaev | f59d921 | 2017-05-30 05:57:52 +0000 | [diff] [blame] | 41 | sub_group_reserve_write_pipe(tmp, tmp); // expected-error{{implicit declaration of function 'sub_group_reserve_write_pipe' is invalid in OpenCL}} |
| 42 | // expected-note@-1{{did you mean 'work_group_reserve_write_pipe'?}} |
| 43 | sub_group_reserve_read_pipe(tmp, tmp); // expected-error{{implicit declaration of function 'sub_group_reserve_read_pipe' is invalid in OpenCL}} |
Anastasia Stulova | 7f8d6dc | 2016-07-04 16:07:18 +0000 | [diff] [blame] | 44 | |
Egor Churaev | f59d921 | 2017-05-30 05:57:52 +0000 | [diff] [blame] | 45 | commit_read_pipe(tmp, tmp); // expected-error{{implicit declaration of function 'commit_read_pipe' is invalid in OpenCL}} |
| 46 | // expected-note@-1{{'commit_read_pipe' declared here}} |
| 47 | commit_write_pipe(tmp, tmp); // expected-error{{implicit declaration of function 'commit_write_pipe' is invalid in OpenCL}} |
| 48 | // expected-note@-1{{did you mean 'commit_read_pipe'?}} |
Anastasia Stulova | 7f8d6dc | 2016-07-04 16:07:18 +0000 | [diff] [blame] | 49 | |
Egor Churaev | f59d921 | 2017-05-30 05:57:52 +0000 | [diff] [blame] | 50 | work_group_commit_read_pipe(tmp, tmp); // expected-error{{implicit declaration of function 'work_group_commit_read_pipe' is invalid in OpenCL}} |
| 51 | // expected-note@-1{{'work_group_commit_read_pipe' declared here}} |
| 52 | // expected-note@-2{{did you mean 'work_group_reserve_read_pipe'?}} |
| 53 | work_group_commit_write_pipe(tmp, tmp); // expected-error{{implicit declaration of function 'work_group_commit_write_pipe' is invalid in OpenCL}} |
| 54 | // expected-note@-1{{'work_group_commit_write_pipe' declared here}} |
| 55 | // expected-note@-2{{did you mean 'work_group_commit_read_pipe'?}} |
Anastasia Stulova | 7f8d6dc | 2016-07-04 16:07:18 +0000 | [diff] [blame] | 56 | |
Egor Churaev | f59d921 | 2017-05-30 05:57:52 +0000 | [diff] [blame] | 57 | sub_group_commit_write_pipe(tmp, tmp); // expected-error{{implicit declaration of function 'sub_group_commit_write_pipe' is invalid in OpenCL}} |
| 58 | // expected-note@-1{{did you mean 'work_group_commit_write_pipe'?}} |
| 59 | sub_group_commit_read_pipe(tmp, tmp); // expected-error{{implicit declaration of function 'sub_group_commit_read_pipe' is invalid in OpenCL}} |
| 60 | |
| 61 | get_pipe_num_packets(tmp); // expected-error{{implicit declaration of function 'get_pipe_num_packets' is invalid in OpenCL}} |
| 62 | // expected-note@-1{{'get_pipe_num_packets' declared here}} |
| 63 | get_pipe_max_packets(tmp); // expected-error{{implicit declaration of function 'get_pipe_max_packets' is invalid in OpenCL}} |
| 64 | // expected-note@-1{{did you mean 'get_pipe_num_packets'?}} |
Anastasia Stulova | 7f8d6dc | 2016-07-04 16:07:18 +0000 | [diff] [blame] | 65 | } |