|
1 |
| -// RUN: %clang_cc1 -Wno-hlsl-implicit-binding -finclude-default-header -triple dxil-pc-shadermodel6.3-compute -fnative-half-type -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s |
| 1 | +// RUN: %clang_cc1 -Wno-hlsl-implicit-binding -finclude-default-header -triple dxil-pc-shadermodel6.3-compute -fnative-half-type -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,DXIL |
| 2 | +// RUN: %clang_cc1 -Wno-hlsl-implicit-binding -finclude-default-header -triple spirv-pc-vulkan1.3-compute -fnative-half-type -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,SPIRV |
2 | 3 |
|
3 |
| -// CHECK: %"__cblayout_$Globals" = type <{ float, float, target("dx.Layout", %__cblayout_S, 4, 0) }> |
| 4 | +// DXIL: %"__cblayout_$Globals" = type <{ float, float, target("dx.Layout", %__cblayout_S, 4, 0) }> |
| 5 | +// SPIRV: %"__cblayout_$Globals" = type <{ float, float, target("spirv.Layout", %__cblayout_S, 4, 0) }> |
4 | 6 | // CHECK: %__cblayout_S = type <{ float }>
|
5 | 7 |
|
6 |
| -// CHECK-DAG: @"$Globals.cb" = global target("dx.CBuffer", target("dx.Layout", %"__cblayout_$Globals", 20, 0, 4, 16)) |
7 |
| -// CHECK-DAG: @a = external addrspace(2) global float |
8 |
| -// CHECK-DAG: @g = external addrspace(2) global float |
9 |
| -// CHECK-DAG: @h = external addrspace(2) global target("dx.Layout", %__cblayout_S, 4, 0), align 4 |
| 8 | +// DXIL-DAG: @"$Globals.cb" = global target("dx.CBuffer", target("dx.Layout", %"__cblayout_$Globals", 20, 0, 4, 16)) |
| 9 | +// DXIL-DAG: @a = external addrspace(2) global float |
| 10 | +// DXIL-DAG: @g = external addrspace(2) global float |
| 11 | +// DXIL-DAG: @h = external addrspace(2) global target("dx.Layout", %__cblayout_S, 4, 0), align 4 |
| 12 | + |
| 13 | +// SPIRV-DAG: @"$Globals.cb" = global target("spirv.VulkanBuffer", target("spirv.Layout", %"__cblayout_$Globals", 20, 0, 4, 16), 2, 0) |
| 14 | +// SPIRV-DAG: @a = external addrspace(12) global float |
| 15 | +// SPIRV-DAG: @g = external addrspace(12) global float |
| 16 | +// SPIRV-DAG: @h = external addrspace(12) global target("spirv.Layout", %__cblayout_S, 4, 0), align 4 |
10 | 17 |
|
11 | 18 | struct EmptyStruct {
|
12 | 19 | };
|
@@ -35,4 +42,5 @@ void main() {
|
35 | 42 | }
|
36 | 43 |
|
37 | 44 | // CHECK: !hlsl.cbs = !{![[CB:.*]]}
|
38 |
| -// CHECK: ![[CB]] = !{ptr @"$Globals.cb", ptr addrspace(2) @a, ptr addrspace(2) @g, ptr addrspace(2) @h} |
| 45 | +// DXIL: ![[CB]] = !{ptr @"$Globals.cb", ptr addrspace(2) @a, ptr addrspace(2) @g, ptr addrspace(2) @h} |
| 46 | +// SPIRV: ![[CB]] = !{ptr @"$Globals.cb", ptr addrspace(12) @a, ptr addrspace(12) @g, ptr addrspace(12) @h} |
0 commit comments