summaryrefslogtreecommitdiffstats
path: root/tests/modules
diff options
context:
space:
mode:
Diffstat (limited to 'tests/modules')
-rw-r--r--tests/modules/extension-warning.slang10
-rw-r--r--tests/modules/implementing-with-ext.slang9
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/modules/extension-warning.slang b/tests/modules/extension-warning.slang
new file mode 100644
index 000000000..874211539
--- /dev/null
+++ b/tests/modules/extension-warning.slang
@@ -0,0 +1,10 @@
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK):
+module mymodule;
+
+// This tests the issue described here: https://github.com/shader-slang/slang/issues/5995
+
+//CHECK: result code = 0
+//CHECK: tests/modules/implementing-with-ext.slang(1): warning 30506: implementing directive contains file extension in module name 'mymodule.slang'. Module names should not include extensions. The compiler will use 'mymodule' as the module name.
+__include "implementing-with-ext";
+
+int moduleFunction() { return 0; }
diff --git a/tests/modules/implementing-with-ext.slang b/tests/modules/implementing-with-ext.slang
new file mode 100644
index 000000000..4e399df7d
--- /dev/null
+++ b/tests/modules/implementing-with-ext.slang
@@ -0,0 +1,9 @@
+implementing "mymodule.slang";
+
+int helperFunction() { return 0; }
+
+void main()
+{
+ int x = moduleFunction();
+ int y = helperFunction();
+}