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
41 lines
2.0 KiB
Plaintext
41 lines
2.0 KiB
Plaintext
// RUN: %clang_cc1 %s -triple spir-unknown-unknown -pedantic -verify -fsyntax-only
|
|
|
|
__global const int& f(__global float &ref) {
|
|
return ref; // expected-error{{reference of type 'const __global int &' cannot bind to a temporary object because of address space mismatch}}
|
|
}
|
|
|
|
int bar(const __global unsigned int &i); // expected-note{{passing argument to parameter 'i' here}}
|
|
//FIXME: With the overload below the call should be resolved
|
|
// successfully. However, current overload resolution logic
|
|
// can't detect this case and therefore fails.
|
|
int bar(const unsigned int &i);
|
|
|
|
typedef short short2 __attribute__((ext_vector_type(2)));
|
|
class C {
|
|
public:
|
|
void gen(const short2 &);
|
|
void glob(__global const short2 &); //expected-note{{passing argument to parameter here}}
|
|
void nested_list(const short2 (&)[2]);
|
|
};
|
|
|
|
void foo() {
|
|
bar(1); // expected-error{{binding reference of type 'const __global unsigned int' to value of type 'int' changes address space}}
|
|
C c;
|
|
c.gen({1, 2});
|
|
c.glob({1, 2}); //expected-error{{binding reference of type 'const __global short2' (vector of 2 'short' values) to value of type 'void' changes address space}}
|
|
c.nested_list({{1, 2}, {3, 4}});
|
|
}
|
|
|
|
// Test addr space conversion with nested pointers
|
|
|
|
extern void nestptr(int *&); // expected-note {{candidate function not viable: no known conversion from '__global int *__private' to '__generic int *__generic &__private' for 1st argument}}
|
|
extern void nestptr_const(int * const &); // expected-note {{candidate function not viable: cannot pass pointer to address space '__constant' as a pointer to address space '__generic' in 1st argument}}
|
|
int test_nestptr(__global int *glob, __constant int *cons, int* gen) {
|
|
nestptr(glob); // expected-error{{no matching function for call to 'nestptr'}}
|
|
// Addr space conversion first occurs on a temporary.
|
|
nestptr_const(glob);
|
|
// No legal conversion between disjoint addr spaces.
|
|
nestptr_const(cons); // expected-error{{no matching function for call to 'nestptr_const'}}
|
|
return *(*cons ? glob : gen);
|
|
}
|