xref: /llvm-project/mlir/test/Interfaces/DataLayoutInterfaces/module.mlir (revision adda597388dc148ac235e755b3e8bbd0a12a3e15)
1// RUN: mlir-opt --test-data-layout-query %s | FileCheck %s
2
3module attributes { dlti.dl_spec = #dlti.dl_spec<
4      #dlti.dl_entry<!test.test_type_with_layout<10>, ["size", 12]>,
5      #dlti.dl_entry<!test.test_type_with_layout<20>, ["alignment", 32]>,
6      #dlti.dl_entry<!test.test_type_with_layout<30>, ["index", 7]>>} {
7  // CHECK-LABEL: @module_level_layout
8  func.func @module_level_layout() {
9     // CHECK: alignment = 32
10     // CHECK: bitsize = 12
11     // CHECK: index = 7
12     // CHECK: preferred = 1
13     // CHECK: size = 2
14    "test.data_layout_query"() : () -> !test.test_type_with_layout<10>
15    return
16  }
17}
18