[clang-tidy][NFC]remove deps of clang in clang tidy test (#116588)
[llvm-project.git] / mlir / test / Dialect / SPIRV / IR / barrier-ops.mlir
blobe0f935b7ce39d745358ec28815b943c25557cea0
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>
10   return
13 // -----
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>
19   return
23 // -----
25 //===----------------------------------------------------------------------===//
26 // spirv.MemoryBarrier
27 //===----------------------------------------------------------------------===//
29 func.func @memory_barrier_0() -> () {
30   // CHECK: spirv.MemoryBarrier <Device>, <Acquire|UniformMemory>
31   spirv.MemoryBarrier <Device>, <Acquire|UniformMemory>
32   return
35 // -----
37 func.func @memory_barrier_1() -> () {
38   // CHECK: spirv.MemoryBarrier <Workgroup>, <Acquire>
39   spirv.MemoryBarrier <Workgroup>, <Acquire>
40   return
43 // -----
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>
48   return