1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-library %s -ast-dump | FileCheck %s
3 // CHECK: FunctionDecl {{.*}} fn 'void (float)'
4 // CHECK-NEXT: ParmVarDecl {{.*}} f 'float'
5 // CHECK-NOT: HLSLParamModifierAttr
8 // CHECK: FunctionDecl {{.*}}6 fn2 'void (float)'
9 // CHECK-NEXT: ParmVarDecl {{.*}} f 'float'
10 // CHECK-NEXT: HLSLParamModifierAttr {{.*}} in
11 // CHECK-NOT: HLSLParamModifierAttr
14 // CHECK: FunctionDecl {{.*}} fn3 'void (out float)'
15 // CHECK-NEXT: ParmVarDecl {{.*}} f 'float &__restrict'
16 // CHECK-NEXT: HLSLParamModifierAttr {{.*}} out
17 // CHECK-NOT: HLSLParamModifierAttr
18 void fn3(out float f);
20 // CHECK: FunctionDecl {{.*}} fn4 'void (inout float)'
21 // CHECK-NEXT: ParmVarDecl {{.*}} f 'float &__restrict'
22 // CHECK-NEXT: HLSLParamModifierAttr {{.*}} inout
23 // CHECK-NOT: HLSLParamModifierAttr
24 void fn4(inout float f);
26 // CHECK: FunctionDecl {{.*}} fn5 'void (inout float)'
27 // CHECK-NEXT: ParmVarDecl {{.*}} f 'float &__restrict'
28 // CHECK-NEXT: HLSLParamModifierAttr {{.*}} inout MergedSpelling
29 // CHECK-NOT: HLSLParamModifierAttr
30 void fn5(out in float f);
32 // CHECK: FunctionDecl {{.*}} fn6 'void (inout float)'
33 // CHECK-NEXT: ParmVarDecl {{.*}} f 'float &__restrict'
34 // CHECK-NEXT: HLSLParamModifierAttr {{.*}} inout MergedSpelling
35 // CHECK-NOT: HLSLParamModifierAttr
36 void fn6(in out float f);
38 // CHECK-NEXT: FunctionTemplateDecl [[Template:0x[0-9a-fA-F]+]] {{.*}} fn7
39 // CHECK-NEXT: TemplateTypeParmDecl {{.*}} referenced typename depth 0 index 0 T
40 // CHECK-NEXT: FunctionDecl {{.*}} fn7 'void (inout T)'
41 // CHECK-NEXT: ParmVarDecl {{.*}} f 'T'
42 // CHECK-NEXT: HLSLParamModifierAttr {{.*}} inout
43 // CHECK-NEXT: FunctionDecl [[Instantiation:0x[0-9a-fA-F]+]] {{.*}} used fn7 'void (inout float)' implicit_instantiation
44 // CHECK-NEXT: TemplateArgument type 'float'
45 // CHECK-NEXT: BuiltinType {{.*}} 'float'
46 // CHECK-NEXT: ParmVarDecl {{.*}} f 'float &__restrict'
47 // CHECK-NEXT: HLSLParamModifierAttr {{.*}} inout
52 // CHECK: FunctionDecl {{.*}} fn8 'void ()'
53 // CHECK-NEXT: CompoundStmt
54 // CHECK-NEXT: DeclStmt
55 // CHECK-NEXT: VarDecl {{.*}} used f 'float'
56 // CHECK-NEXT: CallExpr {{.*}} 'void'
57 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'void (*)(inout float)' <FunctionToPointerDecay>
58 // CHECK-NEXT: DeclRefExpr {{.*}} 'void (inout float)' lvalue
59 // CHECK-SAME: Function [[Instantiation]] 'fn7' 'void (inout float)'
60 // CHECK-SAME: (FunctionTemplate [[Template]] 'fn7')
61 // CHECK-NEXT: HLSLOutArgExpr {{.*}}'float' lvalue