//META: generated=true
//META: model=claude-sonnet-4-6
//META: generated_at=2026-06-02T07:58:55+00:00
//META: source_commit=a01e79278cf0be9772deb8b2be52ee87687697a3
//META: doc_ref=docs/language-reference/statements.md#discard-statement
//META: doc_section_digest=c2e15d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4
//META: purpose=discard used outside a fragment shader context (e.g. compute) is a compile error (E36107).
//META: intent=negative
//META: pipeline_stage=check
//META: warning=Auto-generated. May drift from source. Do not edit by hand.

// Verifies that `discard` in a compute entry point is rejected with E36107.
// The test compiles a compute kernel containing `discard`; CHECK asserts
// E36107 fires, proving the compiler enforces the fragment-only restriction.
//DIAGNOSTIC_TEST:SIMPLE(diag=CHECK,non-exhaustive):-target hlsl -entry computeMain -stage compute

RWStructuredBuffer<int> outputBuffer;

[numthreads(1,1,1)]
void computeMain()
//CHECK: E36107
{
    discard;
    outputBuffer[0] = 1;
}
