summaryrefslogtreecommitdiffstats
path: root/tests/spirv/debug-printf.slang
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-11-17 17:50:16 -0800
committerGitHub <noreply@github.com>2023-11-17 17:50:16 -0800
commitc5a6348326742aa647ae79f95cf543472d827b03 (patch)
tree80b8b379b75d52aadd0c20a80a6b7ac8fcf7f74c /tests/spirv/debug-printf.slang
parent6f22477906072870d3b4a5965592b2e8bdf81381 (diff)
Add spirv intrinsic definition for `printf`. (#3340)
Diffstat (limited to 'tests/spirv/debug-printf.slang')
-rw-r--r--tests/spirv/debug-printf.slang11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/spirv/debug-printf.slang b/tests/spirv/debug-printf.slang
new file mode 100644
index 000000000..cf8bfafa3
--- /dev/null
+++ b/tests/spirv/debug-printf.slang
@@ -0,0 +1,11 @@
+//TEST:SIMPLE(filecheck=CHECK): -target spirv -stage compute -entry main -emit-spirv-directly
+//TEST:SIMPLE(filecheck=CHECK): -target spirv -stage compute -entry main -emit-spirv-via-glsl
+
+void main()
+{
+ printf("test");
+ printf("test1 %d", 5);
+ // CHECK: %[[SET:[0-9]+]] = OpExtInstImport "NonSemantic.DebugPrintf"
+ // CHECK: {{.*}} = OpExtInst %{{[a-zA-Z0-9_]+}} %[[SET]] 1 %{{[a-zA-Z0-9_]+}}
+ // CHECK: {{.*}} = OpExtInst %{{[a-zA-Z0-9_]+}} %[[SET]] 1 %{{[a-zA-Z0-9_]+}} %{{[a-zA-Z0-9_]+}}
+}