summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/diagnostics/entry-point-main-warning.slang14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/diagnostics/entry-point-main-warning.slang b/tests/diagnostics/entry-point-main-warning.slang
new file mode 100644
index 000000000..9d880dbb1
--- /dev/null
+++ b/tests/diagnostics/entry-point-main-warning.slang
@@ -0,0 +1,14 @@
+// Test to check if we emit a warning and rename main to main_ on CUDA, CPU, metal backends
+
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -entry main -target cuda
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -entry main -target metal
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -entry main -target cpp
+[shader("compute")]
+[numthreads(1,1,1)]
+void main(RWBuffer<float> output)
+{
+ output[0] = 1.0f;
+}
+
+// CHECK: warning 40100: entry point 'main' is not allowed, and has been renamed to 'main_0'
+// CHECK: void main_ \ No newline at end of file