[Mlir-commits] [mlir] [mlir] Add metadata to Diagnostic. (PR #99398)

weiwei chen llvmlistbot at llvm.org
Wed Jul 24 10:34:45 PDT 2024


================
@@ -0,0 +1,19 @@
+// RUN: mlir-opt %s -pass-pipeline="builtin.module(func.func(test-diagnostic-metadata))" -o - 2>&1 | FileCheck %s
+// This test verifies that diagnostic handler can filter the diagnostic whether to emit the errors.
+
+// CHECK-LABEL: Test 'test'
+// CHECK-NEXT: 8:3: error: test diagnostic metadata
+// CHECK-NOT: 13:3: error: test diagnostic metadata
----------------
weiweichen wrote:

Ah, yes, I was following [what `diagnostic-handler-filter.mlir` is done for checking the diagnostics](https://github.com/llvm/llvm-project/blob/2e57e6366677390110f5382894c8afeba8da7419/mlir/test/IR/diagnostic-handler-filter.mlir#L5-L6). 

`-verify-diagnostic` is a much better way, updated the test. 

https://github.com/llvm/llvm-project/pull/99398


More information about the Mlir-commits mailing list