11// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - %s -verify
22
3+ // expected-note@+2 {{overlapping resource range here}}
34// expected-error@+1 {{resource ranges b[42;42] and b[42;42] overlap within space = 0 and visibility = All}}
45[RootSignature ("CBV(b42), CBV(b42)" )]
56void bad_root_signature_0 () {}
67
8+ // expected-note@+2 {{overlapping resource range here}}
79// expected-error@+1 {{resource ranges t[0;0] and t[0;0] overlap within space = 3 and visibility = All}}
810[RootSignature ("SRV(t0, space = 3), SRV(t0, space = 3)" )]
911void bad_root_signature_1 () {}
1012
13+ // expected-note@+2 {{overlapping resource range here}}
1114// expected-error@+1 {{resource ranges u[0;0] and u[0;0] overlap within space = 0 and visibility = Pixel}}
1215[RootSignature ("UAV(u0, visibility = SHADER_VISIBILITY_PIXEL), UAV(u0, visibility = SHADER_VISIBILITY_PIXEL)" )]
1316void bad_root_signature_2 () {}
1417
18+ // expected-note@+2 {{overlapping resource range here}}
1519// expected-error@+1 {{resource ranges u[0;0] and u[0;0] overlap within space = 0 and visibility = Pixel}}
1620[RootSignature ("UAV(u0, visibility = SHADER_VISIBILITY_ALL), UAV(u0, visibility = SHADER_VISIBILITY_PIXEL)" )]
1721void bad_root_signature_3 () {}
1822
23+ // expected-note@+2 {{overlapping resource range here}}
1924// expected-error@+1 {{resource ranges u[0;0] and u[0;0] overlap within space = 0 and visibility = Pixel}}
2025[RootSignature ("UAV(u0, visibility = SHADER_VISIBILITY_PIXEL), UAV(u0, visibility = SHADER_VISIBILITY_ALL)" )]
2126void bad_root_signature_4 () {}
2227
28+ // expected-note@+2 {{overlapping resource range here}}
2329// expected-error@+1 {{resource ranges b[0;0] and b[0;0] overlap within space = 0 and visibility = All}}
2430[RootSignature ("RootConstants(num32BitConstants=4, b0), RootConstants(num32BitConstants=2, b0)" )]
2531void bad_root_signature_5 () {}
2632
33+ // expected-note@+2 {{overlapping resource range here}}
2734// expected-error@+1 {{resource ranges s[3;3] and s[3;3] overlap within space = 0 and visibility = All}}
2835[RootSignature ("StaticSampler(s3), StaticSampler(s3)" )]
2936void bad_root_signature_6 () {}
3037
38+ // expected-note@+2 {{overlapping resource range here}}
3139// expected-error@+1 {{resource ranges t[2;5] and t[0;3] overlap within space = 0 and visibility = All}}
3240[RootSignature ("DescriptorTable(SRV(t0, numDescriptors=4), SRV(t2, numDescriptors=4))" )]
3341void bad_root_signature_7 () {}
3442
43+ // expected-note@+2 {{overlapping resource range here}}
3544// expected-error@+1 {{resource ranges u[2;5] and u[0;unbounded) overlap within space = 0 and visibility = Hull}}
3645[RootSignature ("DescriptorTable(UAV(u0, numDescriptors=unbounded), visibility = SHADER_VISIBILITY_HULL), DescriptorTable(UAV(u2, numDescriptors=4))" )]
3746void bad_root_signature_8 () {}
3847
48+ // expected-note@+2 {{overlapping resource range here}}
3949// expected-error@+1 {{resource ranges b[0;2] and b[2;2] overlap within space = 0 and visibility = All}}
4050[RootSignature ("RootConstants(num32BitConstants=4, b2), DescriptorTable(CBV(b0, numDescriptors=3))" )]
4151void bad_root_signature_9 () {}
4252
53+ // expected-note@+2 {{overlapping resource range here}}
4354// expected-error@+1 {{resource ranges s[4;unbounded) and s[17;17] overlap within space = 0 and visibility = All}}
4455[RootSignature ("StaticSampler(s17), DescriptorTable(Sampler(s0, numDescriptors=3),Sampler(s4, numDescriptors=unbounded))" )]
4556void bad_root_signature_10 () {}
4657
58+ // expected-note@+2 {{overlapping resource range here}}
4759// expected-error@+1 {{resource ranges b[45;45] and b[4;unbounded) overlap within space = 0 and visibility = Geometry}}
4860[RootSignature ("DescriptorTable(CBV(b4, numDescriptors=unbounded)), CBV(b45, visibility = SHADER_VISIBILITY_GEOMETRY)" )]
4961void bad_root_signature_11 () {}
@@ -55,10 +67,12 @@ void bad_root_signature_11() {}
5567 " CBV(b0, numDescriptors = 8), " \
5668 ")"
5769
70+ // expected-note@+2 {{overlapping resource range here}}
5871// expected-error@+1 {{resource ranges b[0;7] and b[1;2] overlap within space = 0 and visibility = All}}
5972[RootSignature (ReportFirstOverlap)]
6073void bad_root_signature_12 () {}
6174
75+ // expected-note@+2 {{overlapping resource range here}}
6276// expected-error@+1 {{resource ranges s[2;2] and s[2;2] overlap within space = 0 and visibility = Vertex}}
6377[RootSignature ("StaticSampler(s2, visibility=SHADER_VISIBILITY_ALL), DescriptorTable(Sampler(s2), visibility=SHADER_VISIBILITY_VERTEX)" )]
6478void valid_root_signature_13 () {}
0 commit comments