[llvm] [DebugInfo] Emit linkage name into DWARF for types for Swift (PR #112802)
Adrian Prantl via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 22 09:40:11 PDT 2024
================
@@ -0,0 +1,68 @@
+; RUN: %llc_dwarf -debugger-tune=lldb -accel-tables=Dwarf -filetype=obj -o %t < %s
+; RUN: dsymutil %t -o %t.dSYM
+; RUN: llvm-dwarfdump %t | FileCheck %s
+; RUN: llvm-dwarfdump -debug-names %t | FileCheck --check-prefix=SAME-NAME %s
+; RUN: llvm-dwarfdump -debug-names %t | FileCheck --check-prefix=DIFFERENT-NAME %s
+; RUN: llvm-dwarfdump -debug-names %t | FileCheck --check-prefix=UNIQUE-DIFFERENT-NAME %s
+; RUN: llvm-dwarfdump -debug-names -verify %t | FileCheck --check-prefix=VERIFY %s
+
+
+; CHECK: DW_TAG_structure_type
+; CHECK: DW_AT_name ("SameName")
+; CHECK: DW_AT_linkage_name ("SameName")
+
+; CHECK: DW_TAG_structure_type
+; CHECK: DW_AT_name ("DifferentName")
+; CHECK: DW_AT_linkage_name ("UniqueDifferentName")
+
+; The name count should be 5 (the two variables, "int", "SameName", "DifferentName", "UniqueDifferentName").
+; SAME-NAME: Name count: 6
+
+; The accelarator should only have one entry for the three following names.
+; SAME-NAME: "SameName"
+; SAME-NAME-NOT: "SameName"
+
+; DIFFERENT-NAME: "DifferentName"
+; DIFFERENT-NAME-NOT: "DifferentName"
+
+; UNIQUE-DIFFERENT-NAME: "UniqueDifferentName"
+; UNIQUE-DIFFERENT-NAME-NOT: "UniqueDifferentName"
+
+; Verification should succeed.
+; VERIFY: No errors.
+
+; ModuleID = 't.c'
+source_filename = "t.c"
+target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32"
----------------
adrian-prantl wrote:
You're not specifying a target but do specify a datalayout. I don't know if this could be a problem to compile this on some host architectures?
https://github.com/llvm/llvm-project/pull/112802
More information about the llvm-commits
mailing list