From 9d47a352960efd71494c7dfa0918debd5b405077 Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 21 Jul 2025 21:35:44 -0700 Subject: Fix Conditioanl fields with a semantic. (#7855) * Fix Conditioanl fields with a semantic. * Add unit test. * Fix test. --- tests/spirv/spec-constant-generic.slang | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'tests/spirv') diff --git a/tests/spirv/spec-constant-generic.slang b/tests/spirv/spec-constant-generic.slang index 9a9f7006f..1d7e3c1fe 100644 --- a/tests/spirv/spec-constant-generic.slang +++ b/tests/spirv/spec-constant-generic.slang @@ -1,14 +1,13 @@ //TEST:SIMPLE(filecheck=CHECK): -target spirv //TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -output-using-type -emit-spirv-directly -// CHECK: %[[C0:[0-9A-Za-z_]+]] = OpSpecConstant %int 32 +// CHECK: %[[C0:[0-9A-Za-z_]+]] = OpConstant %int 32 // CHECK: %[[C1:[0-9A-Za-z_]+]] = OpSpecConstant %int 2 // CHECK: %[[COP0:[0-9A-Za-z_]+]] = OpSpecConstantOp %int SDiv %[[C0]] %[[C1]] // CHECK: %[[ARR_TYPE:[0-9A-Za-z_]+]] = OpTypeArray %float %[[COP0]] // CHECK: %[[PT_TYPE:[0-9A-Za-z_]+]] = OpTypePointer Function %[[ARR_TYPE]] -[SpecializationConstant] -const int constValue0 = 32; +static const int constValue0 = 32; [SpecializationConstant] const int constValue1 = 2; @@ -33,11 +32,8 @@ struct MyStruct [numthreads(1, 1, 1)] void computeMain() { - // This test checks we can use spec constants for generic arguments, and also - // we can show that the array size is computed correctly. - // The function call shows that the two arrays are the same type. + // This test checks we can use spec constants for array sizes. MyStruct s; - // CHECK: OpVariable %[[PT_TYPE]] Function func(s.buffer); -- cgit v1.2.3