CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
131 lines
6.8 KiB
Common Lisp
131 lines
6.8 KiB
Common Lisp
// RUN: %clang_cc1 -verify -fsyntax-only %s
|
|
// RUN: %clang_cc1 -Wconversion -verify -fsyntax-only -cl-std=CL2.0 %s
|
|
// RUN: %clang_cc1 -Wconversion -verify -fsyntax-only -cl-std=CL3.0 -cl-ext=-all %s
|
|
// RUN: %clang_cc1 -Wconversion -verify -fsyntax-only -cl-std=CL3.0 %s
|
|
|
|
void test(void) {
|
|
global int *glob;
|
|
local int *loc;
|
|
constant int *con;
|
|
private int *priv;
|
|
global float *glob_wrong_ty;
|
|
typedef constant int const_int_ty;
|
|
const_int_ty *con_typedef;
|
|
|
|
glob = to_global(glob, loc);
|
|
#if (__OPENCL_C_VERSION__ < CL_VERSION_2_0) || (__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && !defined(__opencl_c_generic_address_space))
|
|
// expected-error@-2{{use of undeclared identifier 'to_global'}}
|
|
#else
|
|
// expected-error@-4{{too many arguments to function call, expected 1, have 2}}
|
|
#endif
|
|
|
|
int x;
|
|
glob = to_global(x);
|
|
#if (__OPENCL_C_VERSION__ < CL_VERSION_2_0) || (__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && !defined(__opencl_c_generic_address_space))
|
|
// expected-error@-2{{use of undeclared identifier 'to_global'}}
|
|
#else
|
|
// expected-error@-4{{invalid argument 'x' to function: 'to_global', expecting a generic pointer argument}}
|
|
#endif
|
|
|
|
glob = to_global(con);
|
|
#if (__OPENCL_C_VERSION__ < CL_VERSION_2_0) || (__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && !defined(__opencl_c_generic_address_space))
|
|
// expected-error@-2{{use of undeclared identifier 'to_global'}}
|
|
#else
|
|
// expected-error@-4{{invalid argument 'con' to function: 'to_global', expecting a generic pointer argument}}
|
|
#endif
|
|
|
|
glob = to_global(con_typedef);
|
|
#if (__OPENCL_C_VERSION__ < CL_VERSION_2_0) || (__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && !defined(__opencl_c_generic_address_space))
|
|
// expected-error@-2{{use of undeclared identifier 'to_global'}}
|
|
#else
|
|
// expected-error@-4{{invalid argument 'con_typedef' to function: 'to_global', expecting a generic pointer argument}}
|
|
#endif
|
|
|
|
loc = to_global(glob);
|
|
#if (__OPENCL_C_VERSION__ < CL_VERSION_2_0) || (__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && !defined(__opencl_c_generic_address_space))
|
|
// expected-error@-2{{use of undeclared identifier 'to_global'}}
|
|
#else
|
|
// expected-error@-4{{assigning '__global int *' to '__local int *__private' changes address space of pointer}}
|
|
// expected-warning@-5{{passing non-generic address space pointer to to_global may cause dynamic conversion affecting performance}}
|
|
#endif
|
|
|
|
loc = to_private(glob);
|
|
#if (__OPENCL_C_VERSION__ < CL_VERSION_2_0) || (__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && !defined(__opencl_c_generic_address_space))
|
|
// expected-error@-2{{use of undeclared identifier 'to_private'}}
|
|
#else
|
|
// expected-error@-4{{assigning '__private int *' to '__local int *__private' changes address space of pointer}}
|
|
// expected-warning@-5{{passing non-generic address space pointer to to_private may cause dynamic conversion affecting performance}}
|
|
#endif
|
|
|
|
loc = to_local(glob);
|
|
#if (__OPENCL_C_VERSION__ < CL_VERSION_2_0) || (__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && !defined(__opencl_c_generic_address_space))
|
|
// expected-error@-2{{use of undeclared identifier 'to_local'}}
|
|
#else
|
|
// expected-warning@-4{{passing non-generic address space pointer to to_local may cause dynamic conversion affecting performance}}
|
|
#endif
|
|
|
|
priv = to_global(glob);
|
|
#if (__OPENCL_C_VERSION__ < CL_VERSION_2_0) || (__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && !defined(__opencl_c_generic_address_space))
|
|
// expected-error@-2{{use of undeclared identifier 'to_global'}}
|
|
#else
|
|
// expected-error@-4{{assigning '__global int *' to '__private int *__private' changes address space of pointer}}
|
|
// expected-warning@-5{{passing non-generic address space pointer to to_global may cause dynamic conversion affecting performance}}
|
|
#endif
|
|
|
|
priv = to_private(glob);
|
|
#if (__OPENCL_C_VERSION__ < CL_VERSION_2_0) || (__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && !defined(__opencl_c_generic_address_space))
|
|
// expected-error@-2{{use of undeclared identifier 'to_private'}}
|
|
#else
|
|
// expected-warning@-4{{passing non-generic address space pointer to to_private may cause dynamic conversion affecting performance}}
|
|
#endif
|
|
|
|
|
|
priv = to_local(glob);
|
|
#if (__OPENCL_C_VERSION__ < CL_VERSION_2_0) || (__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && !defined(__opencl_c_generic_address_space))
|
|
// expected-error@-2{{use of undeclared identifier 'to_local'}}
|
|
#else
|
|
// expected-error@-4{{assigning '__local int *' to '__private int *__private' changes address space of pointer}}
|
|
// expected-warning@-5{{passing non-generic address space pointer to to_local may cause dynamic conversion affecting performance}}
|
|
#endif
|
|
|
|
glob = to_global(glob);
|
|
#if (__OPENCL_C_VERSION__ < CL_VERSION_2_0) || (__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && !defined(__opencl_c_generic_address_space))
|
|
// expected-error@-2{{use of undeclared identifier 'to_global'}}
|
|
#else
|
|
// expected-warning@-4{{passing non-generic address space pointer to to_global may cause dynamic conversion affecting performance}}
|
|
#endif
|
|
|
|
glob = to_private(glob);
|
|
#if (__OPENCL_C_VERSION__ < CL_VERSION_2_0) || (__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && !defined(__opencl_c_generic_address_space))
|
|
// expected-error@-2{{use of undeclared identifier 'to_private'}}
|
|
#else
|
|
// expected-error@-4{{assigning '__private int *' to '__global int *__private' changes address space of pointer}}
|
|
// expected-warning@-5{{passing non-generic address space pointer to to_private may cause dynamic conversion affecting performance}}
|
|
#endif
|
|
|
|
glob = to_local(glob);
|
|
#if (__OPENCL_C_VERSION__ < CL_VERSION_2_0) || (__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && !defined(__opencl_c_generic_address_space))
|
|
// expected-error@-2{{use of undeclared identifier 'to_local'}}
|
|
#else
|
|
// expected-error@-4{{assigning '__local int *' to '__global int *__private' changes address space of pointer}}
|
|
// expected-warning@-5{{passing non-generic address space pointer to to_local may cause dynamic conversion affecting performance}}
|
|
#endif
|
|
|
|
global char *glob_c = to_global(loc);
|
|
#if (__OPENCL_C_VERSION__ < CL_VERSION_2_0) || (__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && !defined(__opencl_c_generic_address_space))
|
|
// expected-error@-2{{use of undeclared identifier 'to_global'}}
|
|
#else
|
|
// expected-error@-4{{incompatible pointer types initializing '__global char *__private' with an expression of type '__global int *'}}
|
|
// expected-warning@-5{{passing non-generic address space pointer to to_global may cause dynamic conversion affecting performance}}
|
|
#endif
|
|
|
|
glob_wrong_ty = to_global(glob);
|
|
#if (__OPENCL_C_VERSION__ < CL_VERSION_2_0) || (__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && !defined(__opencl_c_generic_address_space))
|
|
// expected-error@-2{{use of undeclared identifier 'to_global'}}
|
|
#else
|
|
// expected-error@-4{{incompatible pointer types assigning to '__global float *__private' from '__global int *'}}
|
|
// expected-warning@-5{{passing non-generic address space pointer to to_global may cause dynamic conversion affecting performance}}
|
|
#endif
|
|
|
|
}
|