xref: /llvm-project/mlir/test/IR/diagnostic-handler.mlir (revision 1bd1edaf4006ff66a88ac59e0931f22105003a26)
1// RUN: not mlir-opt %s -o - 2>&1 | FileCheck %s
2// This test verifies that diagnostic handler can emit the call stack successfully.
3
4// -----
5
6// Emit the first available call stack in the fused location.
7func.func @constant_out_of_range() {
8  // CHECK: mysource1:0:0: error: 'arith.constant' op failed to verify that all of {value, result} have same type
9  // CHECK-NEXT: mysource2:1:0: note: called from
10  // CHECK-NEXT: mysource3:2:0: note: called from
11  %x = "arith.constant"() {value = 100} : () -> i1 loc(fused["bar", callsite("foo"("mysource1":0:0) at callsite("mysource2":1:0 at "mysource3":2:0))])
12  return
13}
14