• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: %clang_cc1 %s -fblocks -verify -pedantic -fsyntax-only -ferror-limit 100
2
3// Confirm CL2.0 Clang builtins are not available in earlier versions
4
5kernel void dse_builtins() {
6  int tmp;
7  enqueue_kernel(tmp, tmp, tmp, ^(void) { // expected-error{{implicit declaration of function 'enqueue_kernel' is invalid in OpenCL}}
8    return;
9  });
10  unsigned size = get_kernel_work_group_size(^(void) { // expected-error{{implicit declaration of function 'get_kernel_work_group_size' is invalid in OpenCL}}
11    return;
12  });
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}}
14    return;
15  });
16}
17
18void pipe_builtins() {
19  int tmp;
20
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'?}}
26
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}}
29
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'?}}
34
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}}
40
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}}
44
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'?}}
49
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'?}}
56
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'?}}
65}
66