Mercurial > hg > CbC > CbC_llvm
comparison clang/test/SemaHLSL/cb_error.hlsl @ 236:c4bab56944e8 llvm-original
LLVM 16
author | kono |
---|---|
date | Wed, 09 Nov 2022 17:45:10 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
232:70dce7da266c | 236:c4bab56944e8 |
---|---|
1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify | |
2 | |
3 // expected-note@+1 {{declared here}} | |
4 cbuffer a { | |
5 int x; | |
6 }; | |
7 | |
8 int foo() { | |
9 // expected-error@+1 {{'a' does not refer to a value}} | |
10 return sizeof(a); | |
11 } | |
12 | |
13 // expected-error@+1 {{expected unqualified-id}} | |
14 template <typename Ty> cbuffer a { Ty f; }; | |
15 | |
16 // For back-compat reason, it is OK for multiple cbuffer/tbuffer use same name in hlsl. | |
17 // And these cbuffer name only used for reflection, cannot be removed. | |
18 cbuffer A { | |
19 float A; | |
20 } | |
21 | |
22 cbuffer A { | |
23 float b; | |
24 } | |
25 | |
26 tbuffer A { | |
27 float a; | |
28 } | |
29 | |
30 float bar() { | |
31 // cbuffer/tbuffer name will not conflict with other variables. | |
32 return A; | |
33 } | |
34 | |
35 cbuffer a { | |
36 // expected-error@+2 {{unknown type name 'oh'}} | |
37 // expected-error@+1 {{expected ';' after top level declarator}} | |
38 oh no! | |
39 // expected-warning@+1 {{missing terminating ' character}} | |
40 this isn't even valid HLSL code | |
41 despite seeming totally reasonable | |
42 once you understand that HLSL | |
43 is so flaming weird. | |
44 } | |
45 | |
46 tbuffer B { | |
47 // expected-error@+1 {{unknown type name 'flaot'}} | |
48 flaot f; | |
49 } |