File: types.mlir

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
file content (57 lines) | stat: -rw-r--r-- 1,524 bytes parent folder | download | duplicates (6)
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
48
49
50
51
52
53
54
55
56
57
// RUN: mlir-opt --split-input-file --verify-diagnostics --test-data-layout-query %s | FileCheck %s

// expected-error@below {{expected integer attribute in the data layout entry for 'index'}}
module attributes { dlti.dl_spec = #dlti.dl_spec<
  #dlti.dl_entry<index, [32]>>} {
}

// -----

// expected-error@below {{expected a dense i32 elements attribute}}
module attributes {dlti.dl_spec = #dlti.dl_spec<
#dlti.dl_entry<i32, dense<[64,128]> : vector<2xi64>>>
} {}

// -----

// expected-error@below {{expected 1 or 2 elements}}
module attributes {dlti.dl_spec = #dlti.dl_spec<
#dlti.dl_entry<i32, dense<[64,64,64]> : vector<3xi32>>>
} {}

// -----

// expected-error@below {{preferred alignment is expected to be greater than or equal to the abi alignment}}
module attributes {dlti.dl_spec = #dlti.dl_spec<
#dlti.dl_entry<i32, dense<[64,32]> : vector<2xi32>>>
} {}

// -----

// expected-error@below {{the 'test' dialect does not support identifier data layout entries}}
"test.op_with_data_layout"() { dlti.dl_spec = #dlti.dl_spec<
  #dlti.dl_entry<index, 32>,
  #dlti.dl_entry<"test.foo", [32]>>} : () -> ()

// -----

// CHECK-LABEL: @index
module @index attributes { dlti.dl_spec = #dlti.dl_spec<
  #dlti.dl_entry<index, 32>>} {
  func.func @query() {
    // CHECK: bitsize = 32
    "test.data_layout_query"() : () -> index
    return
  }
}

// -----

// CHECK-LABEL: @index_default
module @index_default {
  func.func @query() {
    // CHECK: bitsize = 64
    "test.data_layout_query"() : () -> index
    return
  }
}