1 // RUN: mlir-opt %s -test-opaque-loc -mlir-print-debuginfo -mlir-print-local-scope | FileCheck %s
2 // This test verifies that debug opaque locations can be printed.
4 #set0 = affine_set<(d0) : (1 == 0)>
6 // CHECK: MyLocation: 0: 'test.foo' op
7 // CHECK: nullptr: 'test.foo' op
8 // CHECK: MyLocation: 0: 'test.foo' op
9 // CHECK: MyLocation: 1: 'arith.constant' op
10 // CHECK: nullptr: 'arith.constant' op
11 // CHECK: MyLocation: 1: 'arith.constant' op
13 // CHECK-LABEL: func @inline_notation
14 func.func @inline_notation() -> i32 {
15 // CHECK: -> i32 loc("foo")
16 // CHECK: -> i32 loc("foo")
17 // CHECK: -> i32 loc(unknown)
18 %1 = "test.foo"() : () -> i32 loc("foo")
20 // CHECK: arith.constant 4 : index loc(callsite("foo" at "mysource.cc":10:8))
21 // CHECK: arith.constant 4 : index loc(callsite("foo" at "mysource.cc":10:8))
22 // CHECK: arith.constant 4 : index loc(unknown)
23 %2 = arith.constant 4 : index loc(callsite("foo" at "mysource.cc":10:8))
25 // CHECK: } loc(unknown)
26 affine.for %i0 = 0 to 8 {
27 } loc(fused["foo", "mysource.cc":10:8])
29 // CHECK: } loc(unknown)
30 affine.for %i0 = 0 to 8 {
31 } loc(fused["foo", "mysource.cc":10:8, callsite("foo" at "mysource.cc":10:8)])
33 // CHECK: return %{{.*}} : i32 loc(unknown)
34 return %1 : i32 loc(unknown)