1 // RUN: mlir-opt -split-input-file -verify-diagnostics %s | FileCheck %s
3 //===----------------------------------------------------------------------===//
4 // spirv.ControlBarrier
5 //===----------------------------------------------------------------------===//
7 func.func @control_barrier_0() -> () {
8 // CHECK: spirv.ControlBarrier <Workgroup>, <Device>, <Acquire|UniformMemory>
9 spirv.ControlBarrier <Workgroup>, <Device>, <Acquire|UniformMemory>
15 func.func @control_barrier_1() -> () {
16 // expected-error @+2 {{to be one of}}
17 // expected-error @+1 {{failed to parse SPIRV_ScopeAttr}}
18 spirv.ControlBarrier <Something>, <Device>, <Acquire|UniformMemory>
25 //===----------------------------------------------------------------------===//
26 // spirv.MemoryBarrier
27 //===----------------------------------------------------------------------===//
29 func.func @memory_barrier_0() -> () {
30 // CHECK: spirv.MemoryBarrier <Device>, <Acquire|UniformMemory>
31 spirv.MemoryBarrier <Device>, <Acquire|UniformMemory>
37 func.func @memory_barrier_1() -> () {
38 // CHECK: spirv.MemoryBarrier <Workgroup>, <Acquire>
39 spirv.MemoryBarrier <Workgroup>, <Acquire>
45 func.func @memory_barrier_2() -> () {
46 // expected-error @+1 {{expected at most one of these four memory constraints to be set: `Acquire`, `Release`,`AcquireRelease` or `SequentiallyConsistent`}}
47 spirv.MemoryBarrier <Device>, <Acquire|Release>