llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-backend-mips Author: Deric C. (Icohedron) <details> <summary>Changes</summary> Many of the texture tests were parameterized specifically for Texture2D and Texture2DArray, therefore retaining several 2D-specific literals, including: the `hlsl::dimension` spelling, the width of the offset / ddx / ddy / LOD-location vectors, the operator[] index type and the `spirv.Image` Dim operand. Furthermore, the macro names used for parameterization was inconsistent among test files. This PR re-parameterizes the texture tests to generalize to more than only 2D textures, and keeps the macro names consistent across test files. Each test file now also has a comment describing each macro used in the test. This PR also moves 3 misplaced texture tests under clang/test/SemaHLSL into clang/test/SemaHLSL/Resources. Assisted by: Claude Opus 5 --- <sub>Stack created with <a href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub> --- Patch is 370.99 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/218519.diff 41 Files Affected: - (modified) clang/test/AST/HLSL/Textures-AST.hlsl (+57-20) - (modified) clang/test/AST/HLSL/Textures-scalar-AST.hlsl (+152-120) - (modified) clang/test/AST/HLSL/Textures-shorthand-AST.hlsl (+13-2) - (modified) clang/test/AST/HLSL/Textures-vector-AST.hlsl (+152-120) - (modified) clang/test/CodeGenHLSL/resources/RWTextures-Subscript.hlsl (+37-6) - (modified) clang/test/CodeGenHLSL/resources/Textures-CalculateLevelOfDetail.hlsl (+53-19) - (modified) clang/test/CodeGenHLSL/resources/Textures-Gather.hlsl (+69-25) - (modified) clang/test/CodeGenHLSL/resources/Textures-GetDimensions.hlsl (+68-16) - (modified) clang/test/CodeGenHLSL/resources/Textures-Load.hlsl (+225-138) - (modified) clang/test/CodeGenHLSL/resources/Textures-Mips.hlsl (+31-7) - (modified) clang/test/CodeGenHLSL/resources/Textures-Sample.hlsl (+67-23) - (modified) clang/test/CodeGenHLSL/resources/Textures-SampleBias.hlsl (+60-16) - (modified) clang/test/CodeGenHLSL/resources/Textures-SampleCmp.hlsl (+65-21) - (modified) clang/test/CodeGenHLSL/resources/Textures-SampleCmpLevelZero.hlsl (+57-13) - (modified) clang/test/CodeGenHLSL/resources/Textures-SampleGrad.hlsl (+100-52) - (modified) clang/test/CodeGenHLSL/resources/Textures-SampleLevel.hlsl (+60-16) - (modified) clang/test/CodeGenHLSL/resources/Textures-Subscript.hlsl (+64-10) - (modified) clang/test/CodeGenHLSL/resources/Textures-default-explicit-binding.hlsl (+39-5) - (modified) clang/test/CodeGenHLSL/resources/Textures-default.hlsl (+15-2) - (modified) clang/test/CodeGenHLSL/resources/Textures-shorthand-contexts.hlsl (+21-2) - (removed) clang/test/SemaHLSL/Resources/RWTexture2D-mips-errors.hlsl (-20) - (removed) clang/test/SemaHLSL/Resources/RWTexture2D-unsupported-methods-errors.hlsl (-38) - (removed) clang/test/SemaHLSL/Resources/RWTextures-Subscript.hlsl (-50) - (modified) clang/test/SemaHLSL/Resources/Textures-CalculateLevelOfDetail.hlsl (+19-5) - (renamed) clang/test/SemaHLSL/Resources/Textures-Gather.hlsl (+15-3) - (renamed) clang/test/SemaHLSL/Resources/Textures-GatherCmp-Vulkan.hlsl (+12-2) - (modified) clang/test/SemaHLSL/Resources/Textures-GetDimensions.hlsl (+17-4) - (modified) clang/test/SemaHLSL/Resources/Textures-Load-errors.hlsl (+57-31) - (modified) clang/test/SemaHLSL/Resources/Textures-SampleBias.hlsl (+15-3) - (modified) clang/test/SemaHLSL/Resources/Textures-SampleCmp.hlsl (+23-7) - (modified) clang/test/SemaHLSL/Resources/Textures-SampleCmpLevelZero.hlsl (+23-6) - (modified) clang/test/SemaHLSL/Resources/Textures-SampleGrad.hlsl (+19-5) - (modified) clang/test/SemaHLSL/Resources/Textures-SampleLevel.hlsl (+15-3) - (modified) clang/test/SemaHLSL/Resources/Textures-Sema.hlsl (+24-7) - (modified) clang/test/SemaHLSL/Resources/Textures-Subscript.hlsl (+81-19) - (modified) clang/test/SemaHLSL/Resources/Textures-derivative-availability.hlsl (+35-13) - (modified) clang/test/SemaHLSL/Resources/Textures-double-element-type-errors.hlsl (+24-8) - (modified) clang/test/SemaHLSL/Resources/Textures-integer-element-type.hlsl (+33-6) - (added) clang/test/SemaHLSL/Resources/Textures-mips-errors.hlsl (+71) - (added) clang/test/SemaHLSL/Resources/Textures-unsupported-methods-errors.hlsl (+61) - (removed) clang/test/SemaHLSL/Textures-mips-errors.hlsl (-41) ``````````diff diff --git a/clang/test/AST/HLSL/Textures-AST.hlsl b/clang/test/AST/HLSL/Textures-AST.hlsl index 5d52a0f71b979..2b3feb06fe3fe 100644 --- a/clang/test/AST/HLSL/Textures-AST.hlsl +++ b/clang/test/AST/HLSL/Textures-AST.hlsl @@ -1,7 +1,44 @@ -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump -disable-llvm-passes -finclude-default-header -DTEXTURE=Texture2D -o - %s | FileCheck %s --check-prefixes=CHECK,SRV -DTEXTURE=Texture2D -DINDEX_SIZE=2 -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump -disable-llvm-passes -finclude-default-header -DTEXTURE=Texture2DArray -o - %s | FileCheck %s --check-prefixes=CHECK,SRV,SRV-ARRAY -DTEXTURE=Texture2DArray -DINDEX_SIZE=3 -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump -disable-llvm-passes -finclude-default-header -DTEXTURE=RWTexture2D -DRW=1 -o - %s | FileCheck %s --check-prefixes=CHECK,UAV,UAV-STORE,UAV-TRUNC -DTEXTURE=RWTexture2D -DINDEX_SIZE=2 -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump -disable-llvm-passes -finclude-default-header -DTEXTURE=RWTexture2DArray -DRW=1 -o - %s | FileCheck %s --check-prefixes=CHECK,UAV,UAV-ARRAY,UAV-STORE,UAV-NOTRUNC -DTEXTURE=RWTexture2DArray -DINDEX_SIZE=3 +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump \ +// RUN: -disable-llvm-passes -finclude-default-header -DINDEX_ARG_TYPE=uint3 \ +// RUN: -DINDEX_ARG="uint3(0, 0, 0)" -DTEXTURE=Texture2D -o - %s \ +// RUN: | FileCheck %s --check-prefixes=CHECK,SRV -DTEXTURE=Texture2D \ +// RUN: -DINDEX_DIM=2 -DDIM_NAME=2D +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump \ +// RUN: -disable-llvm-passes -finclude-default-header -DINDEX_ARG_TYPE=uint3 \ +// RUN: -DINDEX_ARG="uint3(0, 0, 0)" -DTEXTURE=Texture2DArray -o - %s \ +// RUN: | FileCheck %s --check-prefixes=CHECK,SRV,SRV-ARRAY \ +// RUN: -DTEXTURE=Texture2DArray -DINDEX_DIM=3 -DDIM_NAME=2D +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump \ +// RUN: -disable-llvm-passes -finclude-default-header -DINDEX_ARG_TYPE=uint3 \ +// RUN: -DINDEX_ARG="uint3(0, 0, 0)" -DTEXTURE=RWTexture2D -DRW=1 -o - %s \ +// RUN: | FileCheck %s --check-prefixes=CHECK,UAV,UAV-STORE,UAV-TRUNC \ +// RUN: -DTEXTURE=RWTexture2D -DINDEX_DIM=2 -DDIM_NAME=2D +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump \ +// RUN: -disable-llvm-passes -finclude-default-header -DINDEX_ARG_TYPE=uint3 \ +// RUN: -DINDEX_ARG="uint3(0, 0, 0)" -DTEXTURE=RWTexture2DArray -DRW=1 -o - \ +// RUN: %s \ +// RUN: | FileCheck %s \ +// RUN: --check-prefixes=CHECK,UAV,UAV-ARRAY,UAV-STORE,UAV-NOTRUNC \ +// RUN: -DTEXTURE=RWTexture2DArray -DINDEX_DIM=3 -DDIM_NAME=2D + +// Parameterized over the texture types in the RUN lines above; adding a texture +// of another dimension only requires new RUN lines. +// +// INDEX_ARG_TYPE the declared type of INDEX_ARG +// INDEX_ARG a literal operator[] index +// TEXTURE resource type name +// INDEX_DIM operator[] index components +// DIM_NAME hlsl::dimension spelling +// RW dx.Texture UAV operand +// +// Check prefixes: +// SRV read-only (SRV) textures +// SRV-ARRAY read-only array textures +// UAV writable (UAV) textures +// UAV-STORE the store through operator[] +// UAV-TRUNC types whose index is narrower than INDEX_ARG_TYPE +// UAV-ARRAY writable array textures +// UAV-NOTRUNC types whose index matches INDEX_ARG_TYPE // CHECK: ClassTemplateDecl {{.*}} [[TEXTURE]] // CHECK: TemplateTypeParmDecl {{.*}} element_type @@ -13,10 +50,10 @@ // SRV-ARRAY-SAME{LITERAL}: [[hlsl::is_array]] // UAV-ARRAY-SAME{LITERAL}: [[hlsl::is_array]] // CHECK-SAME{LITERAL}: [[hlsl::contained_type(element_type)]] -// CHECK-SAME{LITERAL}: [[hlsl::dimension("2D")]] +// CHECK-SAME: {{\[\[}}hlsl::dimension("[[DIM_NAME]]"){{\]\]}} -// SRV: CXXMethodDecl {{.*}} operator[] 'const hlsl_device element_type &(vector<unsigned int, [[INDEX_SIZE]]>) const' inline -// SRV-NEXT: ParmVarDecl {{.*}} Index 'vector<unsigned int, [[INDEX_SIZE]]>' +// SRV: CXXMethodDecl {{.*}} operator[] 'const hlsl_device element_type &(vector<unsigned int, [[INDEX_DIM]]>) const' inline +// SRV-NEXT: ParmVarDecl {{.*}} Index 'vector<unsigned int, [[INDEX_DIM]]>' // SRV-NEXT: CompoundStmt // SRV-NEXT: ReturnStmt // SRV-NEXT: UnaryOperator {{.*}} 'hlsl_device element_type' lvalue prefix '*' cannot overflow @@ -27,14 +64,14 @@ // SRV-SAME{LITERAL}: [[hlsl::resource_class("SRV")]] // SRV-ARRAY-SAME{LITERAL}: [[hlsl::is_array]] // SRV-SAME{LITERAL}: [[hlsl::contained_type(element_type)]] -// SRV-SAME{LITERAL}: [[hlsl::dimension("2D")]] +// SRV-SAME: {{\[\[}}hlsl::dimension("[[DIM_NAME]]"){{\]\]}} // SRV-SAME: ' lvalue .__handle // SRV-NEXT: CXXThisExpr {{.*}} 'const hlsl::[[TEXTURE]]<element_type>' lvalue implicit this -// SRV-NEXT: DeclRefExpr {{.*}} 'vector<unsigned int, [[INDEX_SIZE]]>' lvalue ParmVar {{.*}} 'Index' 'vector<unsigned int, [[INDEX_SIZE]]>' +// SRV-NEXT: DeclRefExpr {{.*}} 'vector<unsigned int, [[INDEX_DIM]]>' lvalue ParmVar {{.*}} 'Index' 'vector<unsigned int, [[INDEX_DIM]]>' // SRV-NEXT: AlwaysInlineAttr -// UAV: CXXMethodDecl {{.*}} operator[] 'hlsl_device element_type &(vector<unsigned int, [[INDEX_SIZE]]>) const' inline -// UAV-NEXT: ParmVarDecl {{.*}} Index 'vector<unsigned int, [[INDEX_SIZE]]>' +// UAV: CXXMethodDecl {{.*}} operator[] 'hlsl_device element_type &(vector<unsigned int, [[INDEX_DIM]]>) const' inline +// UAV-NEXT: ParmVarDecl {{.*}} Index 'vector<unsigned int, [[INDEX_DIM]]>' // UAV-NEXT: CompoundStmt // UAV-NEXT: ReturnStmt // UAV-NEXT: UnaryOperator {{.*}} 'hlsl_device element_type' lvalue prefix '*' cannot overflow @@ -45,10 +82,10 @@ // UAV-SAME{LITERAL}: [[hlsl::resource_class("UAV")]] // UAV-ARRAY-SAME{LITERAL}: [[hlsl::is_array]] // UAV-SAME{LITERAL}: [[hlsl::contained_type(element_type)]] -// UAV-SAME{LITERAL}: [[hlsl::dimension("2D")]] +// UAV-SAME: {{\[\[}}hlsl::dimension("[[DIM_NAME]]"){{\]\]}} // UAV-SAME: ' lvalue .__handle // UAV-NEXT: CXXThisExpr {{.*}} 'const hlsl::[[TEXTURE]]<element_type>' lvalue implicit this -// UAV-NEXT: DeclRefExpr {{.*}} 'vector<unsigned int, [[INDEX_SIZE]]>' lvalue ParmVar {{.*}} 'Index' 'vector<unsigned int, [[INDEX_SIZE]]>' +// UAV-NEXT: DeclRefExpr {{.*}} 'vector<unsigned int, [[INDEX_DIM]]>' lvalue ParmVar {{.*}} 'Index' 'vector<unsigned int, [[INDEX_DIM]]>' // UAV-NEXT: AlwaysInlineAttr // CHECK: CXXMethodDecl {{.*}} GetDimensions 'void (out unsigned int, out unsigned int)' @@ -65,7 +102,7 @@ // SRV-ARRAY-SAME{LITERAL}: [[hlsl::is_array]] // UAV-ARRAY-SAME{LITERAL}: [[hlsl::is_array]] // CHECK-SAME{LITERAL}: [[hlsl::contained_type(element_type)]] -// CHECK-SAME{LITERAL}: [[hlsl::dimension("2D")]] +// CHECK-SAME: {{\[\[}}hlsl::dimension("[[DIM_NAME]]"){{\]\]}} // CHECK-SAME: ' lvalue .__handle // CHECK-NEXT: CXXThisExpr {{.*}} 'hlsl::[[TEXTURE]]<element_type>' lvalue implicit this // CHECK-NEXT: DeclRefExpr {{.*}} 'unsigned int' lvalue ParmVar {{.*}} 'width' 'unsigned int &__restrict' @@ -89,7 +126,7 @@ // SRV-ARRAY-SAME{LITERAL}: [[hlsl::is_array]] // UAV-ARRAY-SAME{LITERAL}: [[hlsl::is_array]] // CHECK-SAME{LITERAL}: [[hlsl::contained_type(element_type)]] -// CHECK-SAME{LITERAL}: [[hlsl::dimension("2D")]] +// CHECK-SAME: {{\[\[}}hlsl::dimension("[[DIM_NAME]]"){{\]\]}} // CHECK-SAME: ' lvalue .__handle // CHECK-NEXT: CXXThisExpr {{.*}} 'hlsl::[[TEXTURE]]<element_type>' lvalue implicit this // CHECK-NEXT: DeclRefExpr {{.*}} 'unsigned int' lvalue ParmVar {{.*}} 'mipLevel' 'unsigned int' @@ -112,7 +149,7 @@ // SRV-ARRAY-SAME{LITERAL}: [[hlsl::is_array]] // UAV-ARRAY-SAME{LITERAL}: [[hlsl::is_array]] // CHECK-SAME{LITERAL}: [[hlsl::contained_type(element_type)]] -// CHECK-SAME{LITERAL}: [[hlsl::dimension("2D")]] +// CHECK-SAME: {{\[\[}}hlsl::dimension("[[DIM_NAME]]"){{\]\]}} // CHECK-SAME: ' lvalue .__handle // CHECK-NEXT: CXXThisExpr {{.*}} 'hlsl::[[TEXTURE]]<element_type>' lvalue implicit this // CHECK-NEXT: DeclRefExpr {{.*}} 'float' lvalue ParmVar {{.*}} 'width' 'float &__restrict' @@ -136,7 +173,7 @@ // SRV-ARRAY-SAME{LITERAL}: [[hlsl::is_array]] // UAV-ARRAY-SAME{LITERAL}: [[hlsl::is_array]] // CHECK-SAME{LITERAL}: [[hlsl::contained_type(element_type)]] -// CHECK-SAME{LITERAL}: [[hlsl::dimension("2D")]] +// CHECK-SAME: {{\[\[}}hlsl::dimension("[[DIM_NAME]]"){{\]\]}} // CHECK-SAME: ' lvalue .__handle // CHECK-NEXT: CXXThisExpr {{.*}} 'hlsl::[[TEXTURE]]<element_type>' lvalue implicit this // CHECK-NEXT: DeclRefExpr {{.*}} 'unsigned int' lvalue ParmVar {{.*}} 'mipLevel' 'unsigned int' @@ -154,8 +191,8 @@ // UAV-STORE-LABEL: FunctionDecl {{.*}} main 'void ()' // UAV-STORE: BinaryOperator {{.*}} 'hlsl_device float' lvalue '=' // UAV-STORE-NEXT: CXXOperatorCallExpr {{.*}} 'hlsl_device float' lvalue '[]' -// UAV-STORE-NEXT: ImplicitCastExpr {{.*}} 'hlsl_device float &(*)(vector<unsigned int, [[INDEX_SIZE]]>) const' <FunctionToPointerDecay> -// UAV-STORE-NEXT: DeclRefExpr {{.*}} 'hlsl_device float &(vector<unsigned int, [[INDEX_SIZE]]>) const' lvalue CXXMethod {{.*}} 'operator[]' 'hlsl_device float &(vector<unsigned int, [[INDEX_SIZE]]>) const' +// UAV-STORE-NEXT: ImplicitCastExpr {{.*}} 'hlsl_device float &(*)(vector<unsigned int, [[INDEX_DIM]]>) const' <FunctionToPointerDecay> +// UAV-STORE-NEXT: DeclRefExpr {{.*}} 'hlsl_device float &(vector<unsigned int, [[INDEX_DIM]]>) const' lvalue CXXMethod {{.*}} 'operator[]' 'hlsl_device float &(vector<unsigned int, [[INDEX_DIM]]>) const' // UAV-STORE-NEXT: ImplicitCastExpr {{.*}} 'const hlsl::[[TEXTURE]]<float>' lvalue <NoOp> // UAV-STORE-NEXT: DeclRefExpr {{.*}} '[[TEXTURE]]<float>':'hlsl::[[TEXTURE]]<float>' lvalue Var {{.*}} 't' '[[TEXTURE]]<float>':'hlsl::[[TEXTURE]]<float>' // UAV-TRUNC-NEXT: ImplicitCastExpr {{.*}} 'vector<uint, 2>' <HLSLVectorTruncation> @@ -168,7 +205,7 @@ TEXTURE<float> t; void main() { - uint3 i = uint3(0, 0, 0); + INDEX_ARG_TYPE i = INDEX_ARG; #if RW t[i] = 1.0f; #endif diff --git a/clang/test/AST/HLSL/Textures-scalar-AST.hlsl b/clang/test/AST/HLSL/Textures-scalar-AST.hlsl index 54506cdb6adff..449373e2b7dfc 100644 --- a/clang/test/AST/HLSL/Textures-scalar-AST.hlsl +++ b/clang/test/AST/HLSL/Textures-scalar-AST.hlsl @@ -1,5 +1,37 @@ -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump -disable-llvm-passes -finclude-default-header -DTEXTURE=Texture2D -DCOORD_TYPE=float2 -DLOD_LOCATION=loc -o - %s | FileCheck %s --check-prefixes=CHECK -DTEXTURE=Texture2D -DCOORD_DIM=2 -DLOCATION_DIM=3 -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump -disable-llvm-passes -finclude-default-header -DTEXTURE=Texture2DArray -DCOORD_TYPE=float3 -DLOD_LOCATION=loc.xy -o - %s | FileCheck %s --check-prefixes=CHECK,ARRAY -DTEXTURE=Texture2DArray -DCOORD_DIM=3 -DLOCATION_DIM=4 +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump \ +// RUN: -disable-llvm-passes -finclude-default-header -DTEXTURE=Texture2D \ +// RUN: -DCOORD_TYPE=float2 -DGRAD_TYPE=float2 -DLOD_LOCATION=loc \ +// RUN: -DOFFSET_ARG="int2(1, 2)" -o - %s \ +// RUN: | FileCheck %s --check-prefixes=CHECK -DTEXTURE=Texture2D \ +// RUN: -DDIM_NAME=2D -DDIM=2 -DCOORD_DIM=2 -DLOAD_DIM=3 \ +// RUN: -DINDEX_TYPE="vector<unsigned int, 2>" +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump \ +// RUN: -disable-llvm-passes -finclude-default-header \ +// RUN: -DTEXTURE=Texture2DArray -DCOORD_TYPE=float3 -DGRAD_TYPE=float2 \ +// RUN: -DLOD_LOCATION=loc.xy -DOFFSET_ARG="int2(1, 2)" -o - %s \ +// RUN: | FileCheck %s --check-prefixes=CHECK,ARRAY -DTEXTURE=Texture2DArray \ +// RUN: -DDIM_NAME=2D -DDIM=2 -DCOORD_DIM=3 -DLOAD_DIM=4 \ +// RUN: -DINDEX_TYPE="vector<unsigned int, 3>" + +// Parameterized over the texture types in the RUN lines above; adding a texture +// of another dimension only requires new RUN lines. +// +// TEXTURE resource type name +// COORD_TYPE sample location type (DIM components plus the array +// slice) +// GRAD_TYPE SampleGrad ddx/ddy type, one component per resource +// dimension +// LOD_LOCATION expression producing a LOD_TYPE location from `loc` +// OFFSET_ARG a literal offset argument +// DIM_NAME hlsl::dimension spelling +// DIM number of resource dimensions (offset, ddx/ddy, LOD +// location) +// COORD_DIM sample location components (DIM plus the array slice) +// LOAD_DIM Load location components (COORD_DIM plus the mip level) +// INDEX_TYPE operator[] index type +// +// Check prefixes: +// ARRAY the resource has an array slice // CHECK: CXXRecordDecl {{.*}} SamplerState definition // CHECK: FinalAttr {{.*}} Implicit final @@ -19,10 +51,10 @@ // CHECK-SAME{LITERAL}: [[hlsl::resource_class("SRV")]] // ARRAY-SAME{LITERAL}: [[hlsl::is_array]] // CHECK-SAME{LITERAL}: [[hlsl::contained_type(element_type)]] -// CHECK-SAME{LITERAL}: [[hlsl::dimension("2D")]] +// CHECK-SAME: {{\[\[}}hlsl::dimension("[[DIM_NAME]]"){{\]\]}} -// CHECK: CXXMethodDecl {{.*}} Load 'element_type (vector<int, [[LOCATION_DIM]]>)' -// CHECK-NEXT: ParmVarDecl {{.*}} Location 'vector<int, [[LOCATION_DIM]]>' +// CHECK: CXXMethodDecl {{.*}} Load 'element_type (vector<int, [[LOAD_DIM]]>)' +// CHECK-NEXT: ParmVarDecl {{.*}} Location 'vector<int, [[LOAD_DIM]]>' // CHECK-NEXT: CompoundStmt // CHECK-NEXT: ReturnStmt // CHECK-NEXT: CStyleCastExpr {{.*}} 'element_type' <Dependent> @@ -32,15 +64,15 @@ // CHECK-SAME{LITERAL}: [[hlsl::resource_class("SRV")]] // ARRAY-SAME{LITERAL}: [[hlsl::is_array]] // CHECK-SAME{LITERAL}: [[hlsl::contained_type(element_type)]] -// CHECK-SAME{LITERAL}: [[hlsl::dimension("2D")]] +// CHECK-SAME: {{\[\[}}hlsl::dimension("[[DIM_NAME]]"){{\]\]}} // CHECK-SAME: ' lvalue .__handle // CHECK-NEXT: CXXThisExpr {{.*}} 'hlsl::[[TEXTURE]]<element_type>' lvalue implicit this -// CHECK-NEXT: DeclRefExpr {{.*}} 'vector<int, [[LOCATION_DIM]]>' lvalue ParmVar {{.*}} 'Location' 'vector<int, [[LOCATION_DIM]]>' +// CHECK-NEXT: DeclRefExpr {{.*}} 'vector<int, [[LOAD_DIM]]>' lvalue ParmVar {{.*}} 'Location' 'vector<int, [[LOAD_DIM]]>' // CHECK-NEXT: AlwaysInlineAttr -// CHECK: CXXMethodDecl {{.*}} Load 'element_type (vector<int, [[LOCATION_DIM]]>, vector<int, 2>)' -// CHECK-NEXT: ParmVarDecl {{.*}} Location 'vector<int, [[LOCATION_DIM]]>' -// CHECK-NEXT: ParmVarDecl {{.*}} Offset 'vector<int, 2>' +// CHECK: CXXMethodDecl {{.*}} Load 'element_type (vector<int, [[LOAD_DIM]]>, vector<int, [[DIM]]>)' +// CHECK-NEXT: ParmVarDecl {{.*}} Location 'vector<int, [[LOAD_DIM]]>' +// CHECK-NEXT: ParmVarDecl {{.*}} Offset 'vector<int, [[DIM]]>' // CHECK-NEXT: CompoundStmt // CHECK-NEXT: ReturnStmt // CHECK-NEXT: CStyleCastExpr {{.*}} 'element_type' <Dependent> @@ -50,15 +82,15 @@ // CHECK-SAME{LITERAL}: [[hlsl::resource_class("SRV")]] // ARRAY-SAME{LITERAL}: [[hlsl::is_array]] // CHECK-SAME{LITERAL}: [[hlsl::contained_type(element_type)]] -// CHECK-SAME{LITERAL}: [[hlsl::dimension("2D")]] +// CHECK-SAME: {{\[\[}}hlsl::dimension("[[DIM_NAME]]"){{\]\]}} // CHECK-SAME: ' lvalue .__handle // CHECK-NEXT: CXXThisExpr {{.*}} 'hlsl::[[TEXTURE]]<element_type>' lvalue implicit this -// CHECK-NEXT: DeclRefExpr {{.*}} 'vector<int, [[LOCATION_DIM]]>' lvalue ParmVar {{.*}} 'Location' 'vector<int, [[LOCATION_DIM]]>' -// CHECK-NEXT: DeclRefExpr {{.*}} 'vector<int, 2>' lvalue ParmVar {{.*}} 'Offset' 'vector<int, 2>' +// CHECK-NEXT: DeclRefExpr {{.*}} 'vector<int, [[LOAD_DIM]]>' lvalue ParmVar {{.*}} 'Location' 'vector<int, [[LOAD_DIM]]>' +// CHECK-NEXT: DeclRefExpr {{.*}} 'vector<int, [[DIM]]>' lvalue ParmVar {{.*}} 'Offset' 'vector<int, [[DIM]]>' // CHECK-NEXT: AlwaysInlineAttr -// CHECK: CXXMethodDecl {{.*}} operator[] 'const hlsl_device element_type &(vector<unsigned int, [[COORD_DIM]]>) const' inline -// CHECK-NEXT: ParmVarDecl {{.*}} Index 'vector<unsigned int, [[COORD_DIM]]>' +// CHECK: CXXMethodDecl {{.*}} operator[] 'const hlsl_device element_type &([[INDEX_TYPE]]) const' inline +// CHECK-NEXT: ParmVarDecl {{.*}} Index '[[INDEX_TYPE]]' // CHECK-NEXT: CompoundStmt // CHECK-NEXT: ReturnStmt // CHECK-NEXT: UnaryOperator {{.*}} 'hlsl_device element_type' lvalue prefix '*' cannot overflow @@ -69,10 +101,10 @@ // CHECK-SAME{LITERAL}: [[hlsl::resource_class("SRV")]] // ARRAY-SAME{LITERAL}: [[hlsl::is_array]] // CHECK-SAME{LITERAL}: [[hlsl::contained_type(element_type)]] -// CHECK-SAME{LITERAL}: [[hlsl::dimension("2D")]] +// CHECK-SAME: {{\[\[}}hlsl::dimension("[[DIM_NAME]]"){{\]\]}} // CHECK-SAME: ' lvalue .__handle // CHECK-NEXT: CXXThisExpr {{.*}} 'const hlsl::[[TEXTURE]]<element_type>' lvalue implicit this -// CHECK-NEXT: DeclRefExpr {{.*}} 'vector<unsigned int, [[COORD_DIM]]>' lvalue ParmVar {{.*}} 'Index' 'vector<unsigned int, [[COORD_DIM]]>' +// CHECK-NEXT: DeclRefExpr {{.*}} '[[INDEX_TYPE]]' lvalue ParmVar {{.*}} 'Index' '[[INDEX_TYPE]]' // CHECK-NEXT: AlwaysInlineAttr // CHECK: CXXMethodDecl {{.*}} Sample 'element_type (hlsl::SamplerState, vector<float, [[COORD_DIM]]>)' @@ -87,7 +119,7 @@ // CHECK-SAME{LITERAL}: [[hlsl::resource_class("SRV")]] // ARRAY-SAME{LITERAL}: [[hlsl::is_array]] // CHECK-SAME{LITERAL}: [[hlsl::contained_type(element_type)]] -// CHECK-SAME{LITERAL}: [[hlsl::dimension("2D")]] +// CHECK-SAME: {{\[\[}}hlsl::dimension("[[DIM_NAME]]"){{\]\]}} // CHECK-SAME: ' lvalue .__handle // CHECK-NEXT: CXXThisExpr {{.*}} 'hlsl::[[TEXTURE]]<element_type>' lvalue implicit this // CHECK-NEXT: MemberExpr {{.*}} '__hlsl_resource_t @@ -97,10 +129,10 @@ // CHECK-NEXT: DeclRefExpr {{.*}} 'vector<float, [[COORD_DIM]]>' lvalue ParmVar {{.*}} 'Location' 'vector<float, [[COORD_DIM]]>' // CHECK-NEXT: AlwaysInlineAttr -// CHECK: CXXMethodDecl {{.*}} Sample 'element_type (hlsl::SamplerState, vector<float, [[COORD_DIM]]>, vector<int, 2>)' +// CHECK: CXXMethodDecl {{.*}} Sample 'element_type (hlsl::SamplerState, vector<float, [[COORD_DIM]]>, vector<int, [[DIM]]>)' // CHECK-NEXT: ParmVarDecl {{.*}} Sampler 'hlsl::SamplerState' // CHECK-NEXT: ParmVarDecl {{.*}} Location 'vector<float, [[COORD_DIM]]>' -// CHECK-NEXT: ParmVarDecl {{.*}} Offset 'vector<int, 2>' +// CHECK-NEXT: ParmVarDecl {{.*}} Offset 'vector<int, [[DIM]]>' // CHECK-NEXT: CompoundStmt // CHECK-NEXT: ReturnStmt // CHECK-NEXT: CStyleCastExpr {{.*}} 'element_type' <Dependent> @@ -110,7 +142,7 @@ // CHECK-SAME{LITERAL}: [[hlsl::resource_class("SRV")]] // ARRAY-SAME{LITERAL}: [[hlsl::is_array]] // CHECK-SAME{LITERAL}: [[hlsl::contained_type(element_type)]] -// CHECK-SAME{LITERAL}: [[hlsl::dimension("2D")]] +// CHECK-SAME: {{\[\[}}hlsl::dimension("[[DIM_NAME]]"){{\]\]}} // CHECK-SAME: ' lvalue .__handle // CHECK-NEXT: CXXThisExpr {{.*}} 'hlsl::[[TEXTURE]]<element_type>' lvalue implicit this // CHECK-NEXT: MemberExpr {{.*}} '__hlsl_resource_t @@ -118,13 +150,13 @@ // CHECK-SAME: ' lvalue .__handle // CHECK-NEXT: DeclRefExpr {{.*}} 'hlsl::SamplerState' lvalue ParmVar {{.*}} 'Sampler' 'hlsl::SamplerState' // CHECK-NEXT: DeclRefExpr {{.*}} 'vector<float, [[COORD_DIM]]>' lvalue ParmVar {{.*}} 'Location' 'vector<float, [[COORD_DIM]]>' -// CHECK-NEXT: DeclRefExpr {{.*}} 'vector<int, 2>' lvalue ParmVar {{.*}} 'Offset' 'vector<int, 2>' +// CHECK-NEXT: DeclRefExpr {{.*}} 'vector<int, [[DIM]]>' lvalue ParmVar {{.*}} 'Offset' 'vector<int, [[DIM]]>' // CHECK-NEXT: AlwaysInlineAttr -// CHECK: CXXMethodDecl {{.*}} Sample 'element_type (hlsl::SamplerState, vector<float, [[COORD_DIM]]>, vector<int, 2>, float)' +// CHECK: CXXMethodDecl {{.*}} Sample 'element_type (hlsl::SamplerState, vector<float, [[COORD_DIM]]>, vector<int, [[DIM]]>, float)' // CHECK-NEXT: ParmVarDecl {{.*}} Sampler 'hlsl::SamplerState' // CHECK-NEXT: ParmVarDecl {{.*}} Location 'vector<float, [[COORD_DIM]]>' -// CHECK-NEXT: ParmVarDecl {{.*}} Offset 'vector<int, 2>' +// CHECK-NEXT: ParmVarDecl {{.*}} Offset 'vector<int, [[DIM]]>' // CHECK-NEXT: ParmVarDecl {{.*}} Clamp 'float' // CHECK-NEXT: CompoundStmt // CHECK-NEXT: ReturnStmt @@ -135,7 +167,7 @@ // CHECK-SAME{LITERAL}: [[hlsl::resource_class("SRV")]] // ARRAY-SAME{LITERAL}: [[hlsl::is_array]] // CHECK-SAME{LITERAL}: [[hlsl::contained_type(element_type)]] -// CHECK-SAME{... [truncated] `````````` </details> https://github.com/llvm/llvm-project/pull/218519 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
