1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify
\r
5 RWBuffer<int> r : register(u0, space0);
\r
10 // this test validates that no diagnostic is emitted on the space parameter, because
\r
11 // this register annotation is not in the global scope.
\r
12 // expected-error@+1 {{'register' attribute only applies to cbuffer/tbuffer and external global variables}}
\r
13 RWBuffer<int> E : register(u2, space3);
\r
23 MyStruct E : register(u2, space3);
\r
27 MyStruct F : register(u3, space4);
\r
30 // this test validates that no diagnostic is emitted on the space parameter, because
\r
31 // this register annotation is not in the global scope.
\r
32 // expected-error@+1 {{binding type 'u' only applies to UAV resources}}
\r
33 float a : register(u2, space3);
\r
36 // expected-error@+1 {{invalid space specifier 's2' used; expected 'space' followed by an integer, like space1}}
\r
37 cbuffer a : register(b0, s2) {
\r
41 // expected-error@+1 {{invalid space specifier 'spaces' used; expected 'space' followed by an integer, like space1}}
\r
42 cbuffer b : register(b2, spaces) {
\r
46 // expected-error@+1 {{wrong argument format for hlsl attribute, use space3 instead}}
\r
47 cbuffer c : register(b2, space 3) {}
\r
49 // expected-error@+1 {{register space cannot be specified on global constants}}
\r
50 int d : register(c2, space3);
\r
52 // expected-error@+1 {{register space cannot be specified on global constants}}
\r
53 int e : register(c2, space0);
\r
55 // expected-error@+1 {{register space cannot be specified on global constants}}
\r
56 int f : register(c2, space00);
\r
59 RWBuffer<int> g : register(u2, space0);
\r
62 RWBuffer<int> h : register(u2, space0);
\r