xref: /llvm-project/clang/test/ParserHLSL/hlsl_parameter_modifiers.cpp (revision d4626216943f8c4712bd17a709e439a0ffd0006b)
1 // RUN: %clang_cc1 %s -verify
2 
3 // expected-error@#fn{{unknown type name 'in'}}
4 // expected-error@#fn{{expected ')'}}
5 // expected-note@#fn{{to match this '('}}
6 void fn(in out float f); // #fn
7 
8 // expected-error@#fn2{{unknown type name 'in'}}
9 // expected-error@#fn2{{expected ')'}}
10 // expected-note@#fn2{{to match this '('}}
11 void fn2(in in float f); // #fn2
12 
13 // expected-error@#fn3{{unknown type name 'out'}}
14 // expected-error@#fn3{{expected ')'}}
15 // expected-note@#fn3{{to match this '('}}
16 void fn3(out out float f); // #fn3
17 
18 // expected-error@#fn4{{unknown type name 'inout'}}
19 // expected-error@#fn4{{expected ')'}}
20 // expected-note@#fn4{{to match this '('}}
21 void fn4(inout in out float f); // #fn4
22 
23 // expected-error@#fn5{{unknown type name 'inout'}}
24 // expected-error@#fn5{{expected ')'}}
25 // expected-note@#fn5{{to match this '('}}
26 void fn5(inout in float f); // #fn5
27 
28 // expected-error@#fn6{{unknown type name 'inout'}}
29 // expected-error@#fn6{{expected ')'}}
30 // expected-note@#fn6{{to match this '('}}
31 void fn6(inout out float f); // #fn6
32 
33 void implicitFn(float f);
34 
35 // expected-error@#inFn{{unknown type name 'in'}}
36 void inFn(in float f); // #inFn
37 
38 // expected-error@#inoutFn{{unknown type name 'inout'}}
39 void inoutFn(inout float f); // #inoutFn
40 
41 // expected-error@#outFn{{unknown type name 'out'}}
42 void outFn(out float f); // #outFn
43 
44 // expected-error@#fn7{{unknown type name 'inout'}}
45 // expected-error@#fn7{{declaration of 'T' shadows template parameter}}
46 // expected-error@#fn7{{expected ')'}}
47 // expected-note@#fn7{{to match this '('}}
48 template <typename T> // expected-note{{template parameter is declared here}}
49 void fn7(inout T f); // #fn7
50 
51