aboutsummaryrefslogtreecommitdiff
path: root/clang/test/SemaHLSL/Semantics/struct_input.hlsl
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaHLSL/Semantics/struct_input.hlsl')
-rw-r--r--clang/test/SemaHLSL/Semantics/struct_input.hlsl19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/SemaHLSL/Semantics/struct_input.hlsl b/clang/test/SemaHLSL/Semantics/struct_input.hlsl
new file mode 100644
index 0000000..66cab95
--- /dev/null
+++ b/clang/test/SemaHLSL/Semantics/struct_input.hlsl
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -finclude-default-header -o - %s -verify
+
+struct S {
+ float4 f0 : SV_Position;
+// expected-error@+2 {{semantic annotations must be present for all parameters of an entry function or patch constant function}}
+// expected-note@+1 {{'f1' used here}}
+ float4 f1;
+};
+
+[shader("pixel")]
+// expected-note@+1 {{'s' declared here}}
+void main(S s) {
+}
+
+[shader("pixel")]
+// expected-error@+2 {{semantic annotations must be present for all parameters of an entry function or patch constant function}}
+// expected-note@+1 {{'f' declared here}}
+void main2(float4 p : SV_POSITION, float4 f)
+{ }