| 1 |
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -o - %s -verify |
| 2 |
// RUN: %clang_cc1 -triple spirv-unknown-vulkan1.3-compute -x hlsl -o - %s -verify |
| 3 |
|
| 4 |
// expected-error@+1 {{expected HLSL Semantic identifier}} |
| 5 |
void Entry(int GI : ) { } |
| 6 |
|
| 7 |
// expected-error@+1 {{unknown HLSL semantic 'SV_IWantAPony'}} |
| 8 |
void Pony(int GI : SV_IWantAPony) { } |
| 9 |
|
| 10 |
// expected-error@+3 {{expected HLSL Semantic identifier}} |
| 11 |
// expected-error@+2 {{expected ')'}} |
| 12 |
// expected-note@+1 {{to match this '('}} |
| 13 |
void SuperPony(int GI : 0) { } |
| 14 |
|
| 15 |
// '_' is a valid CPP identifier. |
| 16 |
void MegaPony(int GI : _) { } |
| 17 |
|
| 18 |
void GarguantuanPony(int GI : _1) { } |
| 19 |
|
| 20 |
void CoolPony(int GI : A0A0) { } |
| 21 |
|
| 22 |
void NicePony(int GI : A_0) { } |
| 23 |
|
| 24 |
void CutePony(int GI : A00) { } |
| 25 |
|
| 26 |
// expected-error@+2 {{expected ')'}} |
| 27 |
// expected-note@+1 {{to match this '('}} |
| 28 |
void DoublePony(int GI : A00 B) { } |
| 29 |
|
| 30 |
// Unicode can be used: |
| 31 |
// https://timsong-cpp.github.io/cppwp/n3337/charname.allowed |
| 32 |
void FrenchPony(int GI : garçon_de_café) { } |
| 33 |
void UnicodePony(int GI : ℮) { } |
| 34 |
|
| 35 |
// Since P1949 seems Emojis are not allowed, even if in the range |
| 36 |
// mentioned in N3337. |
| 37 |
// https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1949r7.html |
| 38 |
|
| 39 |
// expected-error@+2 {{unexpected character <U+1F60A>}} |
| 40 |
// expected-error@+1 {{expected HLSL Semantic identifier}} |
| 41 |
void UTFPony(int GI : 😊) { } |
| 42 |
|
| 43 |
// expected-error@+1 {{character <U+1F60A> not allowed in an identifier}} |
| 44 |
void SmilingPony(int GI : PonyWithA😊) { } |