Skip to content

Commit 680cc11

Browse files
committed
Add first two tests
1 parent c4a68cc commit 680cc11

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// RUN: mlir-opt %s -llvm-data-layout-from-target --split-input-file --verify-diagnostics
2+
3+
// expected-error @+1 {{failed to obtain llvm::DataLayout from #llvm.target}}
4+
module attributes { dlti.dl_spec = #dlti.dl_spec<index = 32>,
5+
llvm.target =
6+
#llvm.target<triple="x64_86-unknown-linux",
7+
chip="lakesky"> } {
8+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// RUN: mlir-opt -llvm-data-layout-from-target -split-input-file %s | FileCheck %s
2+
3+
// CHECK: module attributes
4+
// CHECK-SAME: dlti.dl_spec = #llvm.data_layout
5+
// CHECK-SAME: llvm.target = #llvm.target<
6+
// CHECK-SAME: triple = "x86_64-unknown-linux"
7+
// CHECK-NOT: chip =
8+
// CHECK-NOT: #llvm.target_features
9+
10+
module attributes { llvm.target = #llvm.target<triple = "x86_64-unknown-linux"> } {
11+
}
12+
13+
// -----
14+
15+
// CHECK: module attributes
16+
// CHECK-SAME: dlti.dl_spec = #llvm.data_layout<"[[DL_STR:.*]]">
17+
// CHECK-SAME: llvm.target = #llvm.target<
18+
// CHECK-SAME: triple = "x86_64-unknown-linux"
19+
// CHECK-SAME: chip = "skylake"
20+
// CHECK-SAME: #llvm.target_features<["+mmx", "+sse"]>
21+
22+
module attributes { llvm.target = #llvm.target<triple = "x86_64-unknown-linux",
23+
chip = "skylake",
24+
#llvm.target_features<["+mmx", "+sse"]>> } {
25+
}
26+
27+
// -----
28+
29+
// CHECK: module attributes
30+
// CHECK-SAME: dlti.dl_spec = #dlti.dl_spec<"dlti.endianness" = "little"
31+
// CHECK-SAME: index = 32
32+
// CHECK-SAME: llvm.target = #llvm.target<
33+
// CHECK-SAME: triple = "x86_64-unknown-linux"
34+
// CHECK-SAME: chip = "skylake"
35+
// CHECK-SAME: #llvm.target_features<["+mmx", "+sse"]>
36+
37+
module attributes { dlti.dl_spec = #dlti.dl_spec<index = 32>,
38+
llvm.target = #llvm.target<triple = "x86_64-unknown-linux",
39+
chip = "skylake",
40+
#llvm.target_features<["+mmx", "+sse"]>> } {
41+
}

0 commit comments

Comments
 (0)