|
1 | | -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.2-compute -finclude-default-header -fnative-half-type -emit-llvm -o - %s | FileCheck %s |
| 1 | +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.2-compute -finclude-default-header -fnative-half-type -emit-llvm -o - %s | FileCheck %s -check-prefixes=DXIL,COMMON |
| 2 | +// RUN: %clang_cc1 -triple spirv-pc-vulkan-compute -finclude-default-header -fnative-half-type -emit-llvm -o - %s | FileCheck %s -check-prefixes=SPIRV,COMMON |
2 | 3 |
|
3 | 4 | // NOTE: The type name number and whether the struct is packed or not will mostly |
4 | 5 | // likely change once subscript operators are properly implemented (llvm/llvm-project#95956) |
5 | 6 | // and theinterim field of the contained type is removed. |
6 | 7 |
|
7 | | -// CHECK: %"class.hlsl::RWBuffer" = type <{ target("dx.TypedBuffer", i16, 1, 0, 1) |
8 | | -// CHECK: %"class.hlsl::RWBuffer.0" = type <{ target("dx.TypedBuffer", i16, 1, 0, 0) |
9 | | -// CHECK: %"class.hlsl::RWBuffer.2" = type { target("dx.TypedBuffer", i32, 1, 0, 1) |
10 | | -// CHECK: %"class.hlsl::RWBuffer.3" = type { target("dx.TypedBuffer", i32, 1, 0, 0) |
11 | | -// CHECK: %"class.hlsl::RWBuffer.4" = type { target("dx.TypedBuffer", i64, 1, 0, 1) |
12 | | -// CHECK: %"class.hlsl::RWBuffer.5" = type { target("dx.TypedBuffer", i64, 1, 0, 0) |
13 | | -// CHECK: %"class.hlsl::RWBuffer.6" = type <{ target("dx.TypedBuffer", half, 1, 0, 0) |
14 | | -// CHECK: %"class.hlsl::RWBuffer.8" = type { target("dx.TypedBuffer", float, 1, 0, 0) |
15 | | -// CHECK: %"class.hlsl::RWBuffer.9" = type { target("dx.TypedBuffer", double, 1, 0, 0) |
16 | | -// CHECK: %"class.hlsl::RWBuffer.10" = type { target("dx.TypedBuffer", <4 x i16>, 1, 0, 0) |
17 | | -// CHECK: %"class.hlsl::RWBuffer.11" = type { target("dx.TypedBuffer", <3 x i32>, 1, 0, 0) |
18 | | -// CHECK: %"class.hlsl::RWBuffer.12" = type { target("dx.TypedBuffer", <2 x half>, 1, 0, 0) |
19 | | -// CHECK: %"class.hlsl::RWBuffer.13" = type { target("dx.TypedBuffer", <3 x float>, 1, 0, 0) |
| 8 | +// DXIL: %"class.hlsl::RWBuffer" = type <{ target("dx.TypedBuffer", i16, 1, 0, 1) |
| 9 | +// DXIL: %"class.hlsl::RWBuffer.0" = type <{ target("dx.TypedBuffer", i16, 1, 0, 0) |
| 10 | +// DXIL: %"class.hlsl::RWBuffer.2" = type { target("dx.TypedBuffer", i32, 1, 0, 1) |
| 11 | +// DXIL: %"class.hlsl::RWBuffer.3" = type { target("dx.TypedBuffer", i32, 1, 0, 0) |
| 12 | +// DXIL: %"class.hlsl::RWBuffer.4" = type { target("dx.TypedBuffer", i64, 1, 0, 1) |
| 13 | +// DXIL: %"class.hlsl::RWBuffer.5" = type { target("dx.TypedBuffer", i64, 1, 0, 0) |
| 14 | +// DXIL: %"class.hlsl::RWBuffer.6" = type <{ target("dx.TypedBuffer", half, 1, 0, 0) |
| 15 | +// DXIL: %"class.hlsl::RWBuffer.8" = type { target("dx.TypedBuffer", float, 1, 0, 0) |
| 16 | +// DXIL: %"class.hlsl::RWBuffer.9" = type { target("dx.TypedBuffer", double, 1, 0, 0) |
| 17 | +// DXIL: %"class.hlsl::RWBuffer.10" = type { target("dx.TypedBuffer", <4 x i16>, 1, 0, 0) |
| 18 | +// DXIL: %"class.hlsl::RWBuffer.11" = type { target("dx.TypedBuffer", <3 x i32>, 1, 0, 0) |
| 19 | +// DXIL: %"class.hlsl::RWBuffer.12" = type { target("dx.TypedBuffer", <2 x half>, 1, 0, 0) |
| 20 | +// DXIL: %"class.hlsl::RWBuffer.13" = type { target("dx.TypedBuffer", <3 x float>, 1, 0, 0) |
| 21 | + |
| 22 | +// SPIRV: %"class.hlsl::RWBuffer" = type <{ target("spirv.Image", i16, 5, 2, 0, 0, 2, 0), i16, [6 x i8] }> |
| 23 | +// SPIRV: %"class.hlsl::RWBuffer.0" = type <{ target("spirv.Image", i16, 5, 2, 0, 0, 2, 0), i16, [6 x i8] }> |
| 24 | +// SPIRV: %"class.hlsl::RWBuffer.2" = type <{ target("spirv.Image", i32, 5, 2, 0, 0, 2, 0), i32, [4 x i8] }> |
| 25 | +// SPIRV: %"class.hlsl::RWBuffer.4" = type <{ target("spirv.Image", i32, 5, 2, 0, 0, 2, 0), i32, [4 x i8] }> |
| 26 | +// SPIRV: %"class.hlsl::RWBuffer.6" = type { target("spirv.Image", i64, 5, 2, 0, 0, 2, 0), i64 } |
| 27 | +// SPIRV: %"class.hlsl::RWBuffer.7" = type { target("spirv.Image", i64, 5, 2, 0, 0, 2, 0), i64 } |
| 28 | +// SPIRV: %"class.hlsl::RWBuffer.8" = type <{ target("spirv.Image", half, 5, 2, 0, 0, 2, 0), half, [6 x i8] }> |
| 29 | +// SPIRV: %"class.hlsl::RWBuffer.10" = type <{ target("spirv.Image", float, 5, 2, 0, 0, 2, 0), float, [4 x i8] }> |
| 30 | +// SPIRV: %"class.hlsl::RWBuffer.12" = type { target("spirv.Image", double, 5, 2, 0, 0, 2, 0), double } |
| 31 | +// SPIRV: %"class.hlsl::RWBuffer.13" = type { target("spirv.Image", i16, 5, 2, 0, 0, 2, 0), <4 x i16> } |
| 32 | +// SPIRV: %"class.hlsl::RWBuffer.14" = type { target("spirv.Image", i32, 5, 2, 0, 0, 2, 0), <3 x i32> } |
| 33 | +// SPIRV: %"class.hlsl::RWBuffer.15" = type <{ target("spirv.Image", half, 5, 2, 0, 0, 2, 0), <2 x half>, [4 x i8] }> |
| 34 | +// SPIRV: %"class.hlsl::RWBuffer.17" = type { target("spirv.Image", float, 5, 2, 0, 0, 2, 0), <3 x float> } |
| 35 | + |
| 36 | + |
20 | 37 |
|
21 | 38 | RWBuffer<int16_t> BufI16; |
22 | 39 | RWBuffer<uint16_t> BufU16; |
@@ -55,16 +72,16 @@ void main(int GI : SV_GroupIndex) { |
55 | 72 | BufF32x3[GI] = 0; |
56 | 73 | } |
57 | 74 |
|
58 | | -// CHECK: !{{[0-9]+}} = !{ptr @BufI16, i32 10, i32 2, |
59 | | -// CHECK: !{{[0-9]+}} = !{ptr @BufU16, i32 10, i32 3, |
60 | | -// CHECK: !{{[0-9]+}} = !{ptr @BufI32, i32 10, i32 4, |
61 | | -// CHECK: !{{[0-9]+}} = !{ptr @BufU32, i32 10, i32 5, |
62 | | -// CHECK: !{{[0-9]+}} = !{ptr @BufI64, i32 10, i32 6, |
63 | | -// CHECK: !{{[0-9]+}} = !{ptr @BufU64, i32 10, i32 7, |
64 | | -// CHECK: !{{[0-9]+}} = !{ptr @BufF16, i32 10, i32 8, |
65 | | -// CHECK: !{{[0-9]+}} = !{ptr @BufF32, i32 10, i32 9, |
66 | | -// CHECK: !{{[0-9]+}} = !{ptr @BufF64, i32 10, i32 10, |
67 | | -// CHECK: !{{[0-9]+}} = !{ptr @BufI16x4, i32 10, i32 2, |
68 | | -// CHECK: !{{[0-9]+}} = !{ptr @BufU32x3, i32 10, i32 5, |
69 | | -// CHECK: !{{[0-9]+}} = !{ptr @BufF16x2, i32 10, i32 8, |
70 | | -// CHECK: !{{[0-9]+}} = !{ptr @BufF32x3, i32 10, i32 9, |
| 75 | +// COMMON: !{{[0-9]+}} = !{ptr @BufI16, i32 10, i32 2, |
| 76 | +// COMMON: !{{[0-9]+}} = !{ptr @BufU16, i32 10, i32 3, |
| 77 | +// COMMON: !{{[0-9]+}} = !{ptr @BufI32, i32 10, i32 4, |
| 78 | +// COMMON: !{{[0-9]+}} = !{ptr @BufU32, i32 10, i32 5, |
| 79 | +// COMMON: !{{[0-9]+}} = !{ptr @BufI64, i32 10, i32 6, |
| 80 | +// COMMON: !{{[0-9]+}} = !{ptr @BufU64, i32 10, i32 7, |
| 81 | +// COMMON: !{{[0-9]+}} = !{ptr @BufF16, i32 10, i32 8, |
| 82 | +// COMMON: !{{[0-9]+}} = !{ptr @BufF32, i32 10, i32 9, |
| 83 | +// COMMON: !{{[0-9]+}} = !{ptr @BufF64, i32 10, i32 10, |
| 84 | +// COMMON: !{{[0-9]+}} = !{ptr @BufI16x4, i32 10, i32 2, |
| 85 | +// COMMON: !{{[0-9]+}} = !{ptr @BufU32x3, i32 10, i32 5, |
| 86 | +// COMMON: !{{[0-9]+}} = !{ptr @BufF16x2, i32 10, i32 8, |
| 87 | +// COMMON: !{{[0-9]+}} = !{ptr @BufF32x3, i32 10, i32 9, |
0 commit comments