//META: generated=true
//META: model=claude-opus-5[1m]
//META: generated_at=2026-08-04T00:00:00+00:00
//META: source_commit=7e725f15572c6589ee6d738a8856fb3348f11617
//META: doc_ref=docs/generated/design/pipeline/04-ast-to-ir.md#mapping-ast-constructs-to-ir
//META: doc_section_digest=1195a752790819415908e083ce9656a353d4764f2fab38cc5aa27d92f184c486
//META: purpose=A `ParameterBlock<Narrow>` over a struct of narrow types lowers to a `global_param` whose IR type is `ParameterBlock(%Narrow)`; the inner struct's `field(...)` rows preserve each narrow type.
//META: intent=expansion
//META: pipeline_stage=lower
//META: warning=Auto-generated. May drift from source. Do not edit by hand.

// Expansion: composition axis — ParameterBlock around a struct
// whose fields are narrow types. Verifies the
// `ParameterBlock(%T)` IR-side spelling for the block itself and
// the per-field IR types for the wrapped struct.

//TEST:SIMPLE(filecheck=CHECK):-target spirv-asm -dump-ir -o /dev/null -stage compute -entry main

struct Narrow { int8_t i8; int16_t i16; half h; }

ParameterBlock<Narrow> pb;
uniform RWStructuredBuffer<int> buf;

[numthreads(1, 1, 1)]
void main(uint3 tid : SV_DispatchThreadID)
{
    buf[0] = int(pb.i8) + int(pb.i16) + int(pb.h);
}

// CHECK-LABEL: struct %Narrow
// CHECK: field({{.*}}, Int8)
// CHECK: field({{.*}}, Int16)
// CHECK: field({{.*}}, Half)
// CHECK: [nameHint("pb")]
// CHECK: let {{.*}}pb{{.*}}: ParameterBlock(%Narrow){{.*}}= global_param
