72 lines · plain
1// RUN: mlir-translate -mlir-to-llvmir %s -split-input-file -verify-diagnostics | FileCheck %s2 3// CHECK: target datalayout4// CHECK: E-5// CHECK: A4-6// CHECK: S128-7// CHECK: m:e-8// CHECK: n8:16:32:64-9// CHECK: Fn3210// CHECK: i64:64:12811// CHECK: f80:128:25612// CHECK: p0:32:64:128:3213// CHECK: p1:32:32:32:1614module attributes {dlti.dl_spec = #dlti.dl_spec<15#dlti.dl_entry<"dlti.endianness", "big">,16#dlti.dl_entry<"dlti.alloca_memory_space", 4 : ui32>,17#dlti.dl_entry<"dlti.stack_alignment", 128 : i32>,18#dlti.dl_entry<"dlti.mangling_mode", "e">,19#dlti.dl_entry<"dlti.legal_int_widths", array<i32: 8, 16, 32, 64>>,20#dlti.dl_entry<"dlti.function_pointer_alignment",21 #dlti.function_pointer_alignment<32, function_dependent = true>>,22#dlti.dl_entry<index, 64>,23#dlti.dl_entry<i64, dense<[64,128]> : vector<2xi64>>,24#dlti.dl_entry<f80, dense<[128,256]> : vector<2xi64>>,25#dlti.dl_entry<!llvm.ptr, dense<[32,64,128]> : vector<3xi64>>,26#dlti.dl_entry<!llvm.ptr<1>, dense<[32,32,32,16]> : vector<4xi64>>27>} {28 llvm.func @foo() {29 llvm.return30 }31}32 33// -----34 35// CHECK: target datalayout36// CHECK: e37// CHECK: Fi6438// CHECK-NOT: A039// CHECK-NOT: S040module attributes {dlti.dl_spec = #dlti.dl_spec<41#dlti.dl_entry<"dlti.endianness", "little">,42#dlti.dl_entry<"dlti.alloca_memory_space", 0 : ui32>,43#dlti.dl_entry<"dlti.stack_alignment", 0 : i32>,44#dlti.dl_entry<"dlti.function_pointer_alignment",45 #dlti.function_pointer_alignment<64, function_dependent = false>>46>} {47 llvm.func @bar() {48 llvm.return49 }50}51 52// -----53 54// expected-error@below {{unsupported data layout for non-signless integer 'ui64'}}55module attributes {dlti.dl_spec = #dlti.dl_spec<56#dlti.dl_entry<ui64, dense<[64,128]> : vector<2xi64>>>57} {}58 59// -----60 61// expected-error@below {{unsupported type in data layout: 'bf16'}}62module attributes {dlti.dl_spec = #dlti.dl_spec<63#dlti.dl_entry<bf16, dense<[64,128]> : vector<2xi64>>>64} {}65 66// -----67 68// expected-error@below {{unsupported data layout key "foo"}}69module attributes {dlti.dl_spec = #dlti.dl_spec<70#dlti.dl_entry<"foo", dense<[64,128]> : vector<2xi64>>>71} {}72