aboutsummaryrefslogtreecommitdiff
path: root/clang/test/SemaHLSL/group_shared_202x.hlsl
blob: 7ebc717384e945087a9b7ddf2d63f7cd0ddc367f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -std=hlsl202x  -o - -fsyntax-only %s -verify
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -std=hlsl202y  -o - -fsyntax-only %s -verify

#if __HLSL_VERSION < 2029
// expected-warning@#func{{'auto' type specifier is a HLSL 202y extension}}
// expected-warning@#func_gs{{'auto' type specifier is a HLSL 202y extension}}
// expected-warning@#l{{'auto' type specifier is a HLSL 202y extension}}
// expected-warning@#l2{{'auto' type specifier is a HLSL 202y extension}}
#endif

// expected-error@#func {{return type cannot be qualified with address space}}
auto func() -> groupshared void; // #func

// expected-error@#func_gs {{parameter may not be qualified with an address space}}
auto func(float groupshared) -> void; // #func_gs


// expected-error@#l {{parameter may not be qualified with an address space}}
// expected-warning@#l {{lambdas are a clang HLSL extension}}
auto l = [](groupshared float ) {}; // #l

// expected-error@#l2 {{return type cannot be qualified with address space}}
// expected-warning@#l2 {{lambdas are a clang HLSL extension}}
auto l2 = []() -> groupshared void {}; // #l2

struct S {
// expected-error@+1 {{return type cannot be qualified with address space}}
operator groupshared int() const;

};