summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-08-12 20:53:03 -0700
committerGitHub <noreply@github.com>2024-08-12 20:53:03 -0700
commitb390566b55700582321b09b72c726b8dff9bd819 (patch)
treea2fd8e50fcbde29dd2651e08a78021f2ae9d72de /tests
parent20bd48659d0009de5477380c335e2419f4c66f8b (diff)
Support unicode identifier names. (#4772)
* Support unicode identifier names. * Fix. * Fix language server. * Fix build errors. * Fix. * Fix offset translation in language server.
Diffstat (limited to 'tests')
-rw-r--r--tests/front-end/unicode-identifier.slang21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/front-end/unicode-identifier.slang b/tests/front-end/unicode-identifier.slang
new file mode 100644
index 000000000..c5c4c3c6b
--- /dev/null
+++ b/tests/front-end/unicode-identifier.slang
@@ -0,0 +1,21 @@
+//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=CHECK):-slang -compute -shaderobj -output-using-type
+//TEST(compute, vulkan):COMPARE_COMPUTE_EX(filecheck-buffer=CHECK):-vk -compute -shaderobj -output-using-type -xslang -O0
+
+// Test that we can use unicode characters in identifier names.
+
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer
+RWStructuredBuffer<float> outputBuffer;
+
+static const float π = float.getPi();
+
+float /*комментарий*/ 圆周率_円周率_원주율()
+{
+ return π;
+}
+
+[numthreads(1, 1, 1)]
+void computeMain()
+{
+ // CHECK: 3.14
+ outputBuffer[0] = 圆周率_円周率_원주율();
+}