1 // RUN: mlir-opt --split-input-file --verify-diagnostics --test-data-layout-query %s | FileCheck %s
3 // expected-error@below {{expected integer attribute in the data layout entry for 'index'}}
4 module attributes { dlti.dl_spec = #dlti.dl_spec<
5 #dlti.dl_entry<index, [32]>>} {
10 // expected-error@below {{expected a dense i64 elements attribute}}
11 module attributes {dlti.dl_spec = #dlti.dl_spec<
12 #dlti.dl_entry<i32, dense<[64,128]> : vector<2xi32>>>
17 // expected-error@below {{expected 1 or 2 elements}}
18 module attributes {dlti.dl_spec = #dlti.dl_spec<
19 #dlti.dl_entry<i32, dense<[64,64,64]> : vector<3xi64>>>
24 // expected-error@below {{preferred alignment is expected to be greater than or equal to the abi alignment}}
25 module attributes {dlti.dl_spec = #dlti.dl_spec<
26 #dlti.dl_entry<i32, dense<[64,32]> : vector<2xi64>>>
31 // expected-error@below {{the 'test' dialect does not support identifier data layout entries}}
32 "test.op_with_data_layout"() { dlti.dl_spec = #dlti.dl_spec<
33 #dlti.dl_entry<index, 32>,
34 #dlti.dl_entry<"test.foo", [32]>>} : () -> ()
38 // CHECK-LABEL: @index
39 module @index attributes { dlti.dl_spec = #dlti.dl_spec<
40 #dlti.dl_entry<index, 32>>} {
42 // CHECK: bitsize = 32
44 "test.data_layout_query"() : () -> index
51 // CHECK-LABEL: @index_default
52 module @index_default {
54 // CHECK: bitsize = 64
55 "test.data_layout_query"() : () -> index