[clang] [HLSL] Rewrite semantics parsing (PR #152537)
Chris B via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 8 10:41:09 PDT 2025
Nathan =?utf-8?q?Gauër?= <brioche at google.com>,
Nathan =?utf-8?q?Gauër?= <brioche at google.com>,
Nathan =?utf-8?q?Gauër?= <brioche at google.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/152537 at github.com>
================
@@ -1,7 +1,41 @@
-// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -ast-dump -o - %s -verify
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -o - %s -verify
+// RUN: %clang_cc1 -triple spirv-unknown-vulkan1.3-compute -x hlsl -o - %s -verify
// expected-error at +1 {{expected HLSL Semantic identifier}}
void Entry(int GI : ) { }
-// expected-error at +1 {{unknown HLSL semantic 'SV_IWantAPony'}}
+// expected-error at +1 {{unknown HLSL semantic 'SV_IWANTAPONY'}}
void Pony(int GI : SV_IWantAPony) { }
+
+// expected-error at +3 {{expected HLSL Semantic identifier}}
+// expected-error at +2 {{expected ')'}}
+// expected-note at +1 {{to match this '('}}
+void SuperPony(int GI : 0) { }
+
+// expected-error at +1 {{unknown HLSL semantic '_'}}
+void MegaPony(int GI : _) { }
+
+// expected-error at +1 {{unknown HLSL semantic 'A0A'}}
+void CoolPony(int GI : A0A0) { }
+
+// expected-error at +1 {{unknown HLSL semantic 'A_'}}
+void NicePony(int GI : A_0) { }
+
+// expected-error at +1 {{unknown HLSL semantic 'A'}}
+void CutePony(int GI : A00) { }
+
+// expected-error at +3 {{unknown HLSL semantic 'A'}}
+// expected-error at +2 {{expected ')'}}
+// expected-note at +1 {{to match this '('}}
+void DoublePony(int GI : A00 B) { }
+
+// expected-error at +1 {{unknown HLSL semantic 'é'}}
+void BigPony(int GI : é) { }
+
+// expected-error at +2 {{unexpected character <U+1F60A>}}
+// expected-error at +1 {{expected HLSL Semantic identifier}}
+void UTFPony(int GI : 😊) { }
+
+// expected-error at +2 {{character <U+1F60A> not allowed in an identifier}}
+// expected-error at +1 {{unknown HLSL semantic 'PONYWITHA😊'}}
+void SmilingPony(int GI : PonyWithA😊) { }
----------------
llvm-beanz wrote:
Love this thought... I kinda want emoji in my user defined semantic names now.
https://github.com/llvm/llvm-project/pull/152537
More information about the cfe-commits
mailing list