Files
clang-p2996/clang/test/ParserHLSL/group_shared.hlsl
Xiang Li 7e04c0ad63 [HLSL] Add groupshare address space.
Added keyword, LangAS and TypeAttrbute for groupshared.

Tanslate it to LangAS with asHLSLLangAS.

Make sure it translated into address space 3 for DirectX target.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D135060
2022-10-20 09:29:09 -07:00

17 lines
566 B
HLSL

// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify
extern groupshared float f;
extern float groupshared f; // Ok, redeclaration?
// NOTE:lambda is not enabled except for hlsl202x.
// expected-error@+2 {{expected expression}}
// expected-warning@+1 {{'auto' type specifier is a C++11 extension}}
auto l = []() groupshared {};
// NOTE: remove this error once [[]] attribute is supported except for hlsl202x.
// expected-error@+1 {{expected expression}}
float groupshared [[]] i = 12;
float groupshared const i2 = 12;