xref: /llvm-project/clang/test/CodeGenHLSL/builtins/AppendStructuredBuffer-elementtype.hlsl (revision 1a5e18a492481ff48ca764c8f7d08d231d922382)
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
2
3struct MyStruct {
4  float4 a;
5  int2 b;
6};
7
8// DXIL: %"class.hlsl::AppendStructuredBuffer" = type { target("dx.RawBuffer", i16, 1, 0)
9// DXIL: %"class.hlsl::AppendStructuredBuffer.0" = type { target("dx.RawBuffer", i16, 1, 0)
10// DXIL: %"class.hlsl::AppendStructuredBuffer.1" = type { target("dx.RawBuffer", i32, 1, 0)
11// DXIL: %"class.hlsl::AppendStructuredBuffer.2" = type { target("dx.RawBuffer", i32, 1, 0)
12// DXIL: %"class.hlsl::AppendStructuredBuffer.3" = type { target("dx.RawBuffer", i64, 1, 0)
13// DXIL: %"class.hlsl::AppendStructuredBuffer.4" = type { target("dx.RawBuffer", i64, 1, 0)
14// DXIL: %"class.hlsl::AppendStructuredBuffer.5" = type { target("dx.RawBuffer", half, 1, 0)
15// DXIL: %"class.hlsl::AppendStructuredBuffer.6" = type { target("dx.RawBuffer", float, 1, 0)
16// DXIL: %"class.hlsl::AppendStructuredBuffer.7" = type { target("dx.RawBuffer", double, 1, 0)
17// DXIL: %"class.hlsl::AppendStructuredBuffer.8" = type { target("dx.RawBuffer", <4 x i16>, 1, 0)
18// DXIL: %"class.hlsl::AppendStructuredBuffer.9" = type { target("dx.RawBuffer", <3 x i32>, 1, 0)
19// DXIL: %"class.hlsl::AppendStructuredBuffer.10" = type { target("dx.RawBuffer", <2 x half>, 1, 0)
20// DXIL: %"class.hlsl::AppendStructuredBuffer.11" = type { target("dx.RawBuffer", <3 x float>, 1, 0)
21// DXIL: %"class.hlsl::AppendStructuredBuffer.12" = type { target("dx.RawBuffer", %struct.MyStruct, 1, 0)
22// DXIL: %struct.MyStruct = type { <4 x float>, <2 x i32>, [8 x i8] }
23
24AppendStructuredBuffer<int16_t> BufI16;
25AppendStructuredBuffer<uint16_t> BufU16;
26AppendStructuredBuffer<int> BufI32;
27AppendStructuredBuffer<uint> BufU32;
28AppendStructuredBuffer<int64_t> BufI64;
29AppendStructuredBuffer<uint64_t> BufU64;
30AppendStructuredBuffer<half> BufF16;
31AppendStructuredBuffer<float> BufF32;
32AppendStructuredBuffer<double> BufF64;
33AppendStructuredBuffer< vector<int16_t, 4> > BufI16x4;
34AppendStructuredBuffer< vector<uint, 3> > BufU32x3;
35AppendStructuredBuffer<half2> BufF16x2;
36AppendStructuredBuffer<float3> BufF32x3;
37// TODO: AppendStructuredBuffer<snorm half> BufSNormF16;
38// TODO: AppendStructuredBuffer<unorm half> BufUNormF16;
39// TODO: AppendStructuredBuffer<snorm float> BufSNormF32;
40// TODO: AppendStructuredBuffer<unorm float> BufUNormF32;
41// TODO: AppendStructuredBuffer<snorm double> BufSNormF64;
42// TODO: AppendStructuredBuffer<unorm double> BufUNormF64;
43AppendStructuredBuffer<MyStruct> BufMyStruct;
44
45[numthreads(1,1,1)]
46void main(int GI : SV_GroupIndex) {
47}
48