From fc6aea37483446372425aca8471f0e8bf7c3a910 Mon Sep 17 00:00:00 2001 From: amidescent <221220072+amidescent@users.noreply.github.com> Date: Sat, 9 Aug 2025 12:30:30 -0300 Subject: [SPIR-V] Emit control flags for `branch/flatten` decorations (#8134) Co-authored-by: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --- tests/bugs/branch-attribute.slang | 9 ++++++--- tests/bugs/branch-switch-attribute.slang | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'tests/bugs') diff --git a/tests/bugs/branch-attribute.slang b/tests/bugs/branch-attribute.slang index 17e30a278..95288ecfa 100644 --- a/tests/bugs/branch-attribute.slang +++ b/tests/bugs/branch-attribute.slang @@ -1,10 +1,13 @@ -//TEST:SIMPLE(filecheck=CHECK): -target hlsl -profile cs_5_0 -entry computeMain +//TEST:SIMPLE(filecheck=HLSL): -target hlsl -profile cs_5_0 -entry computeMain +//TEST:SIMPLE(filecheck=SPIRV): -target spirv -O0 //TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer RWStructuredBuffer outputBuffer; -// CHECK: [branch] -// CHECK: [flatten] +// HLSL: [branch] +// HLSL: [flatten] +// SPIRV: OpSelectionMerge {{.*}} DontFlatten +// SPIRV: OpSelectionMerge {{.*}} Flatten [numthreads(4, 1, 1)] void computeMain(int3 dispatchThreadID : SV_DispatchThreadID) diff --git a/tests/bugs/branch-switch-attribute.slang b/tests/bugs/branch-switch-attribute.slang index 761b80e9e..5fe82b7e4 100644 --- a/tests/bugs/branch-switch-attribute.slang +++ b/tests/bugs/branch-switch-attribute.slang @@ -1,9 +1,11 @@ -//TEST:SIMPLE(filecheck=CHECK): -target hlsl -profile cs_5_0 -entry computeMain +//TEST:SIMPLE(filecheck=HLSL): -target hlsl -profile cs_5_0 -entry computeMain +//TEST:SIMPLE(filecheck=SPIRV): -target spirv -O0 //TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer RWStructuredBuffer outputBuffer; -// CHECK: [branch] +// HLSL: [branch] +// SPIRV: OpSelectionMerge {{.*}} DontFlatten [numthreads(4, 1, 1)] void computeMain(int3 dispatchThreadID : SV_DispatchThreadID) -- cgit v1.2.3