summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-09-05 11:53:14 -0700
committerGitHub <noreply@github.com>2024-09-05 11:53:14 -0700
commit879ee3d187e577189eba9aed7bc6326b740cb627 (patch)
tree2317bf727e7958efacea24a3bcf6534a44c1827f /tests
parenta3b25ceb4021811d481c9c4a07a8d029329f01f3 (diff)
Support entrypoints defined in a namespace. (#5011)
* Support entrypoints defined in a namespace. * Fix test.
Diffstat (limited to 'tests')
-rw-r--r--tests/diagnostics/command-line/entry-point-redundant-stage.slang6
-rw-r--r--tests/language-feature/namespaces/entrypoint-in-namespace.slang20
2 files changed, 24 insertions, 2 deletions
diff --git a/tests/diagnostics/command-line/entry-point-redundant-stage.slang b/tests/diagnostics/command-line/entry-point-redundant-stage.slang
index 9507b1ea0..788d7e290 100644
--- a/tests/diagnostics/command-line/entry-point-redundant-stage.slang
+++ b/tests/diagnostics/command-line/entry-point-redundant-stage.slang
@@ -1,5 +1,7 @@
// entry-point-redundant-stage.slang
-//DIAGNOSTIC_TEST:SIMPLE:-stage vertex -stage vertex
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK):-stage vertex -stage vertex
-//DIAGNOSTIC_TEST:SIMPLE:-entry vsMain -stage vertex -stage vertex
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK):-entry vsMain -stage vertex -stage vertex
+
+// CHECK: was specified more than once
diff --git a/tests/language-feature/namespaces/entrypoint-in-namespace.slang b/tests/language-feature/namespaces/entrypoint-in-namespace.slang
new file mode 100644
index 000000000..e91aa5ee3
--- /dev/null
+++ b/tests/language-feature/namespaces/entrypoint-in-namespace.slang
@@ -0,0 +1,20 @@
+//TEST:SIMPLE(filecheck=CHECK): -target spirv -entry Pixel.MyType.Main -stage fragment
+
+// Test that we can compile an entrypoint defined in a namespace.
+
+// CHECK: OpEntryPoint
+struct PSInput
+{
+ float4 color : COLOR;
+};
+
+namespace Pixel
+{
+ struct MyType
+ {
+ static float4 Main(PSInput input) : SV_TARGET
+ {
+ return input.color;
+ }
+ }
+} \ No newline at end of file