1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -std=hlsl202x -o - -fsyntax-only %s -verify
2 extern groupshared float f;
3 extern float groupshared f; // Ok, redeclaration?
5 // expected-error@+1 {{return type cannot be qualified with address space}}
6 auto l = []() -> groupshared void {};
7 // expected-error@+1 {{expected a type}}
8 auto l2 = []() -> groupshared {};
10 float groupshared [[]] i = 12;
12 float groupshared const i2 = 12;
18 extern groupshared float f;
20 // expected-error@+1 {{'auto' return without trailing return type; deduced return types are a C++14 extension}}
26 // NOTE: groupshared and const are stripped off thanks to lvalue to rvalue conversions and we deduce float for the return type.
27 auto l = [&]() { return f; };
28 auto l2 = [&]() { return cf; };