Skip to content

Commit 78622f6

Browse files
committed
add sema check
1 parent a725b6e commit 78622f6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -finclude-default-header -o - %s -verify
2+
3+
struct S {
4+
float4 f0 : SV_Position;
5+
// expected-error@+2 {{semantic annotations must be present for all parameters of an entry function or patch constant function}}
6+
// expected-note@+1 {{'f1' used here}}
7+
float4 f1;
8+
};
9+
10+
[shader("pixel")]
11+
// expected-note@+1 {{'s' declared here}}
12+
void main(S s) {
13+
}
14+
15+
[shader("pixel")]
16+
// expected-error@+2 {{semantic annotations must be present for all parameters of an entry function or patch constant function}}
17+
// expected-note@+1 {{'f' declared here}}
18+
void main2(float4 p : SV_POSITION, float4 f)
19+
{ }

0 commit comments

Comments
 (0)