[Mlir-commits] [mlir] [mlir] Add support for DIGlobalVariable and DIGlobalVariableExpression (PR #73367)

Christian Ulmann llvmlistbot at llvm.org
Wed Nov 29 00:53:43 PST 2023


================
@@ -263,3 +265,25 @@ llvm.func @dbg_intrinsics_with_no_location(%arg0: i32) -> (i32) {
   llvm.intr.dbg.label #di_label
   llvm.return %arg0 : i32
 }
+
+// -----
+
+// CHECK: @global_with_expr_1 = external global i64, !dbg !0
+// CHECK: @global_with_expr_2 = external global i64, !dbg !5
+// CHECK: !llvm.module.flags = !{!8}
+// CHECK: !llvm.dbg.cu = !{!2}
+// CHECK: !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
----------------
Dinistro wrote:

Please do not test for specific metadata IDs. Match them as one matches SSA IDs. You can also use `{{.*}}` in some places.
We want to avoid explicit matching to ensure that extending unrelated parts will not break hundreds of test cases.

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


More information about the Mlir-commits mailing list