Commit 54a4c36 1 parent e294346 commit 54a4c36 Copy full SHA for 54a4c36
File tree 4 files changed +12
-3
lines changed
4 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1
1
# RUN: python %s | filecheck %s
2
2
3
+ from pathlib import Path
4
+
3
5
from xdsl .context import Context
4
6
from xdsl .dialects import get_all_dialects
5
7
from xdsl .dialects .irdl .irdl import DialectOp
19
21
ctx .register_dialect (n , f )
20
22
21
23
# Open the IRDL description of cmath, parse it
22
- f = open ("tests/filecheck/dialects/irdl/cmath.irdl.mlir" )
24
+
25
+ file_path = Path (__file__ ).parent / "cmath.irdl.mlir"
26
+ f = file_path .open ()
23
27
parser = Parser (ctx , f .read ())
24
28
module = parser .parse_module ()
25
29
32
36
ctx .register_dialect ("cmath" , lambda : dialect )
33
37
34
38
# Roundtrip a cmath file!
35
- f = open ( "tests/filecheck/dialects/ cmath/ cmath_ops.mlir" )
39
+ f = ( Path ( __file__ ). parent . parent / " cmath" / " cmath_ops.mlir"). open ( )
36
40
parser = Parser (ctx , f .read ())
37
41
module = parser .parse_module ()
38
42
module .verify ()
Original file line number Diff line number Diff line change 1
1
# RUN: python %s | filecheck %s
2
+ from pathlib import Path
2
3
3
4
from xdsl .context import Context
4
5
from xdsl .dialects import get_all_dialects
20
21
ctx .register_dialect (n , f )
21
22
22
23
# Open the IRDL description of cmath, parse it
23
- f = open ( "tests/filecheck/dialects/irdl/ cmath.irdl.mlir" )
24
+ f = ( Path ( __file__ ). parent / " cmath.irdl.mlir"). open ( )
24
25
parser = Parser (ctx , f .read ())
25
26
module = parser .parse_module ()
26
27
Original file line number Diff line number Diff line change
1
+ // RUN: true
2
+
3
+ // Support file for apply_pdl_extra_file.mlir
4
+
1
5
pdl.pattern : benefit (1 ) {
2
6
%zero_attr = pdl.attribute = 0
3
7
%root = pdl.operation " test.op" {" attr" = %zero_attr }
You can’t perform that action at this time.
0 commit comments