Skip to content

Commit

Permalink
tests: Remove module from arith filecheck tests (#3809)
Browse files Browse the repository at this point in the history
This PR to de-indents tests by removing the implicitly added
`builtin.module`.

@superlopuh I applied my script to similar files within that test
subfolder while at it.

As discussed
[here](#3802 (comment)).
  • Loading branch information
compor authored Jan 30, 2025
1 parent 258be65 commit 6c0a6e9
Show file tree
Hide file tree
Showing 4 changed files with 281 additions and 300 deletions.
51 changes: 24 additions & 27 deletions tests/filecheck/dialects/arith/arith_attrs.mlir
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
// RUN: XDSL_ROUNDTRIP

"builtin.module"() ({

"test.op"() {attrs = [
#arith.fastmath<reassoc>,
// CHECK: #arith.fastmath<reassoc>
#arith<fastmath<reassoc>>,
// CHECK-SAME: #arith.fastmath<reassoc>
#arith.fastmath<nnan>,
// CHECK-SAME: #arith.fastmath<nnan>
#arith.fastmath<ninf>,
// CHECK-SAME: #arith.fastmath<ninf>
#arith.fastmath<nsz>,
// CHECK-SAME: #arith.fastmath<nsz>
#arith.fastmath<arcp>,
// CHECK-SAME: #arith.fastmath<arcp>
#arith.fastmath<contract>,
// CHECK-SAME: #arith.fastmath<contract>
#arith.fastmath<afn>,
// CHECK-SAME: #arith.fastmath<afn>
#arith.fastmath<none>,
// CHECK-SAME: #arith.fastmath<none>
#arith.fastmath<fast>,
// CHECK-SAME: #arith.fastmath<fast>
#arith.fastmath<nnan,nsz>
// CHECK-SAME: #arith.fastmath<nnan,nsz>
]}: () -> ()
}) : () -> ()
"test.op"() {attrs = [
#arith.fastmath<reassoc>,
// CHECK: #arith.fastmath<reassoc>
#arith<fastmath<reassoc>>,
// CHECK-SAME: #arith.fastmath<reassoc>
#arith.fastmath<nnan>,
// CHECK-SAME: #arith.fastmath<nnan>
#arith.fastmath<ninf>,
// CHECK-SAME: #arith.fastmath<ninf>
#arith.fastmath<nsz>,
// CHECK-SAME: #arith.fastmath<nsz>
#arith.fastmath<arcp>,
// CHECK-SAME: #arith.fastmath<arcp>
#arith.fastmath<contract>,
// CHECK-SAME: #arith.fastmath<contract>
#arith.fastmath<afn>,
// CHECK-SAME: #arith.fastmath<afn>
#arith.fastmath<none>,
// CHECK-SAME: #arith.fastmath<none>
#arith.fastmath<fast>,
// CHECK-SAME: #arith.fastmath<fast>
#arith.fastmath<nnan,nsz>
// CHECK-SAME: #arith.fastmath<nnan,nsz>
]}: () -> ()
30 changes: 9 additions & 21 deletions tests/filecheck/dialects/arith/arith_invalid.mlir
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
// RUN: xdsl-opt %s --split-input-file --verify-diagnostics | filecheck %s

"builtin.module"() ({

%lhs, %rhs = "test.op"() : () -> (i32, i64)
%res = "arith.addi"(%lhs, %rhs) : (i32, i64) -> i32

// CHECK: attribute i32 expected from variable 'T', but got i64
}) : () -> ()
%lhs, %rhs = "test.op"() : () -> (i32, i64)
%res = "arith.addi"(%lhs, %rhs) : (i32, i64) -> i32
// CHECK: attribute i32 expected from variable 'T', but got i64

// -----

"builtin.module"() ({

%index = "test.op"() : () -> index
%res = "arith.index_cast"(%index) : (index) -> index
// CHECK: 'arith.index_cast' op operand type 'index' and result type 'index' are cast incompatible

}) : () -> ()
%index = "test.op"() : () -> index
%res = "arith.index_cast"(%index) : (index) -> index
// CHECK: 'arith.index_cast' op operand type 'index' and result type 'index' are cast incompatible

// -----

"builtin.module"() ({

%i32 = "test.op"() : () -> i32
%res = "arith.index_cast"(%i32) : (i32) -> i32
// CHECK: 'arith.index_cast' op operand type 'i32' and result type 'i32' are cast incompatible

}) : () -> ()
%i32 = "test.op"() : () -> i32
%res = "arith.index_cast"(%i32) : (i32) -> i32
// CHECK: 'arith.index_cast' op operand type 'i32' and result type 'i32' are cast incompatible
Loading

0 comments on commit 6c0a6e9

Please sign in to comment.