//TEST:SIMPLE(filecheck=CHECK_GLSL): -allow-glsl -stage compute -entry computeMain -target glsl //TEST:SIMPLE(filecheck=CHECK_SPV): -allow-glsl -stage compute -entry computeMain -target spirv -emit-spirv-directly //TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -compute -entry computeMain -allow-glsl //TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -compute -entry computeMain -allow-glsl -emit-spirv-directly #version 460 groupshared uint raceConditionShared; //TEST_INPUT:ubuffer(data=[0], stride=4):out,name=outputBuffer buffer MyBlockName2 { uint data[]; } outputBuffer; layout(local_size_x = 4) in; bool testBarrier() { for (int i = 0; i < 4; i++) { raceConditionShared = 3; barrier(); raceConditionShared = 1; if (raceConditionShared != 1) return false; } return true && raceConditionShared == 1 ; } void computeMain() { outputBuffer.data[0] = true && testBarrier() ; // CHECK_GLSL: void main( // CHECK_SPV: OpEntryPoint // BUF: 1 }