|
10 | 10 | // RUN: %clang_cc1 -triple dxil-pc-shadermodel5.0-compute -x hlsl -ast-dump -o - %s -DFAIL -verify |
11 | 11 | // RUN: %clang_cc1 -triple dxil-pc-shadermodel4.0-compute -x hlsl -ast-dump -o - %s -DFAIL -verify |
12 | 12 |
|
| 13 | +// RUN: %clang_cc1 -triple spirv-pc-vulkan1.3-compute -x hlsl -ast-dump -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-SPIRV |
| 14 | + |
13 | 15 | #if __SHADER_TARGET_STAGE == __SHADER_STAGE_COMPUTE || __SHADER_TARGET_STAGE == __SHADER_STAGE_MESH || __SHADER_TARGET_STAGE == __SHADER_STAGE_AMPLIFICATION || __SHADER_TARGET_STAGE == __SHADER_STAGE_LIBRARY |
14 | 16 | #ifdef FAIL |
15 | 17 |
|
@@ -88,24 +90,30 @@ int entry() { |
88 | 90 |
|
89 | 91 | // Because these two attributes match, they should both appear in the AST |
90 | 92 | [numthreads(2,2,1)] |
91 | | -// CHECK: HLSLNumThreadsAttr 0x{{[0-9a-fA-F]+}} <line:90:2, col:18> 2 2 1 |
| 93 | +// CHECK: HLSLNumThreadsAttr 0x{{[0-9a-fA-F]+}} <line:{{[0-9]+}}:2, col:18> 2 2 1 |
92 | 94 | int secondFn(); |
93 | 95 |
|
94 | 96 | [numthreads(2,2,1)] |
95 | | -// CHECK: HLSLNumThreadsAttr 0x{{[0-9a-fA-F]+}} <line:94:2, col:18> 2 2 1 |
| 97 | +// CHECK: HLSLNumThreadsAttr 0x{{[0-9a-fA-F]+}} <line:{{[0-9]+}}:2, col:18> 2 2 1 |
96 | 98 | int secondFn() { |
97 | 99 | return 1; |
98 | 100 | } |
99 | 101 |
|
100 | 102 | [numthreads(4,2,1)] |
101 | | -// CHECK: HLSLNumThreadsAttr 0x{{[0-9a-fA-F]+}} <line:100:2, col:18> 4 2 1 |
| 103 | +// CHECK: HLSLNumThreadsAttr 0x{{[0-9a-fA-F]+}} <line:{{[0-9]+}}:2, col:18> 4 2 1 |
102 | 104 | int onlyOnForwardDecl(); |
103 | 105 |
|
104 | | -// CHECK: HLSLNumThreadsAttr 0x{{[0-9a-fA-F]+}} <line:100:2, col:18> Inherited 4 2 1 |
| 106 | +// CHECK: HLSLNumThreadsAttr 0x{{[0-9a-fA-F]+}} <line:{{[0-9]+}}:2, col:18> Inherited 4 2 1 |
105 | 107 | int onlyOnForwardDecl() { |
106 | 108 | return 1; |
107 | 109 | } |
108 | 110 |
|
| 111 | +#ifdef __spirv__ |
| 112 | +[numthreads(4,2,128)] |
| 113 | +// CHECK-SPIRV: HLSLNumThreadsAttr 0x{{[0-9a-fA-F]+}} <line:{{[0-9]+}}:2, col:20> 4 2 128 |
| 114 | +int largeZ(); |
| 115 | +#endif |
| 116 | + |
109 | 117 | #else // Vertex and Pixel only beyond here |
110 | 118 | // expected-error-re@+1 {{attribute 'numthreads' is unsupported in '{{[A-Za-z]+}}' shaders, requires one of the following: compute, amplification, mesh}} |
111 | 119 | [numthreads(1,1,1)] |
|
0 commit comments