Files
TheRock/compiler/amd-llvm/clang/test/SemaHLSL/Language/groupsharedArgs/InOut.hlsl
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

91 lines
4.1 KiB
HLSL

// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -finclude-default-header -std=hlsl202x -verify -Wconversion %s
groupshared uint SharedData;
void fn1(inout uint Sh) {
Sh = 5;
}
void fn2(inout groupshared uint Sh);
// expected-error@-1{{'inout' attribute is not compatible with 'groupshared' attribute}}
void fn3(in groupshared uint Sh);
// expected-error@-1{{'in' attribute is not compatible with 'groupshared' attribute}}
void fn4(out groupshared uint Sh);
// expected-error@-1{{'out' attribute is not compatible with 'groupshared' attribute}}
void fn5(groupshared inout uint Sh);
// expected-error@-1{{'inout' attribute is not compatible with 'groupshared' attribute}}
void fn6(groupshared in uint Sh);
// expected-error@-1{{'in' attribute is not compatible with 'groupshared' attribute}}
void fn7(groupshared out uint Sh);
// expected-error@-1{{'out' attribute is not compatible with 'groupshared' attribute}}
template<typename T>
void fn8(inout T A);
// expected-note@-1{{candidate template ignored: substitution failure [with T = groupshared uint]: 'inout' attribute is not compatible with 'groupshared' attribute}}
template void fn8<groupshared uint>(inout groupshared uint A);
// expected-error@-1{{'inout' attribute is not compatible with 'groupshared' attribute}}
// expected-error@-2{{explicit instantiation of 'fn8' does not refer to a function template, variable template, member function, member class, or static data member}}
template<typename T>
void fn9(out T A);
// expected-note@-1{{candidate template ignored: substitution failure [with T = groupshared uint]: 'out' attribute is not compatible with 'groupshared' attribute}}
template void fn9<groupshared uint>(out groupshared uint A);
// expected-error@-1{{'out' attribute is not compatible with 'groupshared' attribute}}
// expected-error@-2{{explicit instantiation of 'fn9' does not refer to a function template, variable template, member function, member class, or static data member}}
template<typename T>
void fn10(in T A);
// expected-note@-1{{candidate template ignored: substitution failure [with T = groupshared uint]: 'in' attribute is not compatible with 'groupshared' attribute}}
template void fn10<groupshared uint>(in groupshared uint A);
// expected-error@-1{{'in' attribute is not compatible with 'groupshared' attribute}}
// expected-error@-2{{explicit instantiation of 'fn10' does not refer to a function template, variable template, member function, member class, or static data member}}
// expected-note@+2{{candidate template ignored: substitution failure [with T = groupshared uint]: 'inout' attribute is not compatible with 'groupshared' attribute}}
template<typename T>
void fn11(inout T A, inout T B) {
A = B;
}
// expected-note@+2{{candidate template ignored: substitution failure [with T = groupshared uint]: 'out' attribute is not compatible with 'groupshared' attribute}}
template<typename T>
void fn12(out T A, out T B) {
A = B;
}
// expected-note@+2{{candidate template ignored: substitution failure [with T = groupshared uint]: 'in' attribute is not compatible with 'groupshared' attribute}}
template<typename T>
void fn13(in T A, in T B) {
A = B;
}
template<typename T>
T fn14(inout groupshared T A) {
// expected-error@-1{{'inout' attribute is not compatible with 'groupshared' attribute}}
return A;
}
template<typename T>
T fn15(in groupshared T A) {
// expected-error@-1{{'in' attribute is not compatible with 'groupshared' attribute}}
return A;
}
template<typename T>
T fn16(out groupshared T A) {
// expected-error@-1{{'out' attribute is not compatible with 'groupshared' attribute}}
return A;
}
void fn0() {
fn1(SharedData);
// expected-warning@-1{{passing groupshared variable to a parameter annotated with inout. See 'groupshared' parameter annotation added in 202x}}
fn11<groupshared uint>(SharedData, SharedData);
// expected-error@-1{{no matching function for call to 'fn11'}}
fn12<groupshared uint>(SharedData, SharedData);
// expected-error@-1{{no matching function for call to 'fn12'}}
fn13<groupshared uint>(SharedData, SharedData);
// expected-error@-1{{no matching function for call to 'fn13'}}
}