| 1 |
// RUN: %clang_cc1 -O1 -Wno-unused-value -triple spirv64 -fsycl-is-device -verify %s -o - |
| 2 |
// RUN: %clang_cc1 -O1 -Wno-unused-value -triple spirv64 -verify %s -cl-std=CL3.0 -x cl -o - |
| 3 |
// RUN: %clang_cc1 -O1 -Wno-unused-value -triple spirv32 -verify %s -cl-std=CL3.0 -x cl -o - |
| 4 |
|
| 5 |
void test_num_workgroups(int* p) { |
| 6 |
__builtin_spirv_num_workgroups(0); |
| 7 |
__builtin_spirv_num_workgroups(p); // expected-error{{incompatible pointer to integer conversion}} |
| 8 |
__builtin_spirv_num_workgroups(0, 0); // expected-error{{too many arguments to function call, expected 1, have 2}} |
| 9 |
__builtin_spirv_num_workgroups(); // expected-error{{too few arguments to function call, expected 1, have 0}} |
| 10 |
} |
| 11 |
|
| 12 |
void test_workgroup_size(int* p) { |
| 13 |
__builtin_spirv_workgroup_size(0); |
| 14 |
__builtin_spirv_workgroup_size(p); // expected-error{{incompatible pointer to integer conversion}} |
| 15 |
__builtin_spirv_workgroup_size(0, 0); // expected-error{{too many arguments to function call, expected 1, have 2}} |
| 16 |
__builtin_spirv_workgroup_size(); // expected-error{{too few arguments to function call, expected 1, have 0}} |
| 17 |
} |
| 18 |
|
| 19 |
void test_workgroup_id(int* p) { |
| 20 |
__builtin_spirv_workgroup_id(0); |
| 21 |
__builtin_spirv_workgroup_id(p); // expected-error{{incompatible pointer to integer conversion}} |
| 22 |
__builtin_spirv_workgroup_id(0, 0); // expected-error{{too many arguments to function call, expected 1, have 2}} |
| 23 |
__builtin_spirv_workgroup_id(); // expected-error{{too few arguments to function call, expected 1, have 0}} |
| 24 |
} |
| 25 |
|
| 26 |
void test_local_invocation_id(int* p) { |
| 27 |
__builtin_spirv_local_invocation_id(0); |
| 28 |
__builtin_spirv_local_invocation_id(p); // expected-error{{incompatible pointer to integer conversion}} |
| 29 |
__builtin_spirv_local_invocation_id(0, 0); // expected-error{{too many arguments to function call, expected 1, have 2}} |
| 30 |
__builtin_spirv_local_invocation_id(); // expected-error{{too few arguments to function call, expected 1, have 0}} |
| 31 |
} |
| 32 |
|
| 33 |
void test_global_invocation_id(int* p) { |
| 34 |
__builtin_spirv_global_invocation_id(0); |
| 35 |
__builtin_spirv_global_invocation_id(p); // expected-error{{incompatible pointer to integer conversion}} |
| 36 |
__builtin_spirv_global_invocation_id(0, 0); // expected-error{{too many arguments to function call, expected 1, have 2}} |
| 37 |
__builtin_spirv_global_invocation_id(); // expected-error{{too few arguments to function call, expected 1, have 0}} |
| 38 |
} |
| 39 |
|
| 40 |
void test_global_size(int* p) { |
| 41 |
__builtin_spirv_global_size(0); |
| 42 |
__builtin_spirv_global_size(p); // expected-error{{incompatible pointer to integer conversion}} |
| 43 |
__builtin_spirv_global_size(0, 0); // expected-error{{too many arguments to function call, expected 1, have 2}} |
| 44 |
__builtin_spirv_global_size(); // expected-error{{too few arguments to function call, expected 1, have 0}} |
| 45 |
} |
| 46 |
|
| 47 |
void test_global_offset(int* p) { |
| 48 |
__builtin_spirv_global_offset(0); |
| 49 |
__builtin_spirv_global_offset(p); // expected-error{{incompatible pointer to integer conversion}} |
| 50 |
__builtin_spirv_global_offset(0, 0); // expected-error{{too many arguments to function call, expected 1, have 2}} |
| 51 |
__builtin_spirv_global_offset(); // expected-error{{too few arguments to function call, expected 1, have 0}} |
| 52 |
} |
| 53 |
|
| 54 |
void test_subgroup_size() { |
| 55 |
__builtin_spirv_subgroup_size(); |
| 56 |
__builtin_spirv_subgroup_size(0); // expected-error{{too many arguments to function call, expected 0, have 1}} |
| 57 |
} |
| 58 |
|
| 59 |
void test_subgroup_max_size() { |
| 60 |
__builtin_spirv_subgroup_max_size(); |
| 61 |
__builtin_spirv_subgroup_max_size(0); // expected-error{{too many arguments to function call, expected 0, have 1}} |
| 62 |
} |
| 63 |
|
| 64 |
void test_num_subgroups() { |
| 65 |
__builtin_spirv_num_subgroups(); |
| 66 |
__builtin_spirv_num_subgroups(0); // expected-error{{too many arguments to function call, expected 0, have 1}} |
| 67 |
} |
| 68 |
|
| 69 |
void test_subgroup_id() { |
| 70 |
__builtin_spirv_subgroup_id(); |
| 71 |
__builtin_spirv_subgroup_id(0); // expected-error{{too many arguments to function call, expected 0, have 1}} |
| 72 |
} |
| 73 |
|
| 74 |
void test_subgroup_local_invocation_id() { |
| 75 |
__builtin_spirv_subgroup_local_invocation_id(); |
| 76 |
__builtin_spirv_subgroup_local_invocation_id(0); // expected-error{{too many arguments to function call, expected 0, have 1}} |
| 77 |
} |