File: verify.mlir

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (47 lines) | stat: -rw-r--r-- 1,552 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// RUN: mlir-opt %s -split-input-file -verify-diagnostics | FileCheck %s

// FileCheck test must have at least one CHECK statement.
// CHECK-LABEL: @no_op
func.func @no_op(%arg0: !async.token) {
  return
}

// -----

func.func @wrong_async_await_arg_type(%arg0: f32) {
  // expected-error @+1 {{'async.await' op operand #0 must be async value type or async token type, but got 'f32'}}
  async.await %arg0 : f32
}

// -----

func.func @wrong_async_await_result_type(%arg0: !async.value<f32>) {
  // expected-error @+1 {{'async.await' op result type 'f64' does not match async value type 'f32'}}
  %0 = "async.await"(%arg0): (!async.value<f32>) -> f64
}


// -----
// expected-error @+1 {{'async.func' op result is expected to be at least of size 1, but got 0}}
async.func @wrong_async_func_void_result_type(%arg0: f32) {
  return
}


// -----
// expected-error @+1 {{'async.func' op result type must be async value type or async token type, but got 'f32'}}
async.func @wrong_async_func_result_type(%arg0: f32) -> f32 {
  return %arg0 : f32
}

// -----
// expected-error @+1 {{'async.func' op  results' (optional) async token type is expected to appear as the 1st return value, but got 2}}
async.func @wrong_async_func_token_type_placement(%arg0: f32) -> (!async.value<f32>, !async.token) {
  return %arg0 : f32
}

// -----
async.func @wrong_async_func_return_type(%arg0: f32) -> (!async.token, !async.value<i32>) {
  // expected-error @+1 {{'async.return' op operand types do not match the types returned from the parent FuncOp}}
  return %arg0 : f32
}