Skip to content

Commit 21b33b5

Browse files
committed
test
1 parent 319057c commit 21b33b5

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

mlir/test/Pass/remark-final.mlir

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// RUN: mlir-opt %s --test-remark --remarks-filter="category.*" --remark-policy=final --remark-format=yaml --remarks-output-file=%t.yaml
2+
// RUN: FileCheck %t.yaml < %s
3+
module @foo {
4+
"test.op"() : () -> ()
5+
6+
}
7+
8+
// CHECK-NOT: This is a test passed remark (should be dropped)
9+
10+
// CHECK: --- !Failure
11+
// CHECK: Name: test-remark
12+
// CHECK: DebugLoc: { File: '../mlir/test/Pass/remark-final.mlir', Line: 4,
13+
// CHECK: Column: 3 }
14+
// CHECK: Function: '<unknown function>'
15+
// CHECK: Args:
16+
// CHECK: - Remark: This is a test failed remark
17+
// CHECK: - Reason: because we are testing the remark pipeline
18+
// CHECK: - Suggestion: try using the remark pipeline feature
19+
20+
// CHECK: --- !Passed
21+
// CHECK: Pass: category-1-passed
22+
// CHECK: Name: test-remark
23+
// CHECK: DebugLoc: { File: '../mlir/test/Pass/remark-final.mlir', Line: 4,
24+
// CHECK-NEXT: Column: 3 }
25+
// CHECK: Function: '<unknown function>'
26+
// CHECK: Args:
27+
// CHECK: - Remark: This is a test passed remark
28+
// CHECK: - Reason: because we are testing the remark pipeline
29+
// CHECK: - Suggestion: try using the remark pipeline feature
30+
31+
// CHECK: --- !Analysis
32+
// CHECK: Pass: category-2-analysis
33+
// CHECK: Name: test-remark
34+
// CHECK: DebugLoc: { File: '../mlir/test/Pass/remark-final.mlir', Line: 4,
35+
// CHECK-NEXT: Column: 3 }
36+
// CHECK: Function: '<unknown function>'
37+
// CHECK: Args:
38+
// CHECK: - Remark: This is a test analysis remark

mlir/test/lib/Pass/TestRemarksPass.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ class TestRemarkPass : public PassWrapper<TestRemarkPass, OperationPass<>> {
4343
<< remark::add("This is a test missed remark")
4444
<< remark::reason("because we are testing the remark pipeline")
4545
<< remark::suggest("try using the remark pipeline feature");
46-
46+
mlir::remark::passed(
47+
loc,
48+
remark::RemarkOpts::name("test-remark").category("category-1-passed"))
49+
<< remark::add("This is a test passed remark (should be dropped)")
50+
<< remark::reason("because we are testing the remark pipeline")
51+
<< remark::suggest("try using the remark pipeline feature");
4752
mlir::remark::passed(
4853
loc,
4954
remark::RemarkOpts::name("test-remark").category("category-1-passed"))

0 commit comments

Comments
 (0)