| 1 |
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -std=hlsl202x -o - -fsyntax-only %s -verify |
| 2 |
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -std=hlsl202y -o - -fsyntax-only %s -verify |
| 3 |
|
| 4 |
#if __HLSL_VERSION < 2029 |
| 5 |
// expected-warning@#func{{'auto' type specifier is a HLSL 202y extension}} |
| 6 |
// expected-warning@#func_gs{{'auto' type specifier is a HLSL 202y extension}} |
| 7 |
// expected-warning@#l{{'auto' type specifier is a HLSL 202y extension}} |
| 8 |
// expected-warning@#l2{{'auto' type specifier is a HLSL 202y extension}} |
| 9 |
#endif |
| 10 |
|
| 11 |
// expected-error@#func {{return type cannot be qualified with address space}} |
| 12 |
auto func() -> groupshared void; // #func |
| 13 |
|
| 14 |
// expected-error@#func_gs {{parameter may not be qualified with an address space}} |
| 15 |
auto func(float groupshared) -> void; // #func_gs |
| 16 |
|
| 17 |
|
| 18 |
// expected-error@#l {{parameter may not be qualified with an address space}} |
| 19 |
// expected-warning@#l {{lambdas are a clang HLSL extension}} |
| 20 |
auto l = [](groupshared float ) {}; // #l |
| 21 |
|
| 22 |
// expected-error@#l2 {{return type cannot be qualified with address space}} |
| 23 |
// expected-warning@#l2 {{lambdas are a clang HLSL extension}} |
| 24 |
auto l2 = []() -> groupshared void {}; // #l2 |
| 25 |
|
| 26 |
struct S { |
| 27 |
// expected-error@+1 {{return type cannot be qualified with address space}} |
| 28 |
operator groupshared int() const; |
| 29 |
|
| 30 |
}; |