[llvm] 74ad441 - Split DWARF v2 tests to exclude 64-bit AIX targets (#189077)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 6 06:21:37 PDT 2026
Author: Lei Huang
Date: 2026-04-06T09:21:31-04:00
New Revision: 74ad441a8001f349194d2c5487d24623784b6cfe
URL: https://github.com/llvm/llvm-project/commit/74ad441a8001f349194d2c5487d24623784b6cfe
DIFF: https://github.com/llvm/llvm-project/commit/74ad441a8001f349194d2c5487d24623784b6cfe.diff
LOG: Split DWARF v2 tests to exclude 64-bit AIX targets (#189077)
64-bit AIX requires DWARF64 format, which was only introduced in DWARF
v3. DWARF v2 only supports 32-bit DWARF format, making it incompatible
with 64-bit AIX (the compiler throws a fatal error). These changes split
DWARF v2 tests into separate files that exclude 64-bit AIX targets while
still running on 32-bit AIX and other 64-bit platforms where DWARF v2 is
supported.
Added:
llvm/test/DebugInfo/Generic/debug-info-enum-dwarf2.ll
llvm/test/DebugInfo/Generic/incorrect-variable-debugloc1-dwarf2.ll
llvm/test/DebugInfo/Generic/restrict-dwarf2.ll
Modified:
llvm/test/DebugInfo/Generic/debug-info-enum.ll
llvm/test/DebugInfo/Generic/incorrect-variable-debugloc1.ll
llvm/test/DebugInfo/Generic/restrict.ll
Removed:
################################################################################
diff --git a/llvm/test/DebugInfo/Generic/debug-info-enum-dwarf2.ll b/llvm/test/DebugInfo/Generic/debug-info-enum-dwarf2.ll
new file mode 100644
index 0000000000000..d424e17356686
--- /dev/null
+++ b/llvm/test/DebugInfo/Generic/debug-info-enum-dwarf2.ll
@@ -0,0 +1,15 @@
+; Test enumeration representation in DWARF debug info for DWARF v2:
+; * test value representation for each possible underlying integer type
+; * test the integer type is as expected
+; * test the DW_AT_enum_class attribute is present (resp. absent) as expected.
+; * test that DW_AT_type is present for v2 when strict DWARF is not enabled.
+
+; This file contains the dwarf-version=2 tests extracted from debug-info-enum.ll.
+; DWARF v2 is incompatible with 64-bit XCOFF/AIX (requires DWARF64 format which needs DWARF v3+).
+
+; UNSUPPORTED: target=powerpc64{{.*}}-aix{{.*}}
+
+; RUN: llc -debugger-tune=gdb -dwarf-version=2 -filetype=obj -o %t.o < %S/debug-info-enum.ll
+; RUN: llvm-dwarfdump -debug-info %t.o | FileCheck %S/debug-info-enum.ll --check-prefixes=CHECK,CHECK-TYPE
+; RUN: llc -debugger-tune=gdb -dwarf-version=2 -strict-dwarf=true -filetype=obj -o %t.o < %S/debug-info-enum.ll
+; RUN: llvm-dwarfdump -debug-info %t.o | FileCheck %S/debug-info-enum.ll --check-prefixes=CHECK,CHECK-DW2-STRICT
diff --git a/llvm/test/DebugInfo/Generic/debug-info-enum.ll b/llvm/test/DebugInfo/Generic/debug-info-enum.ll
index 9af465d59b7d9..67b48eeac0357 100644
--- a/llvm/test/DebugInfo/Generic/debug-info-enum.ll
+++ b/llvm/test/DebugInfo/Generic/debug-info-enum.ll
@@ -9,10 +9,8 @@
; RUN: llvm-dwarfdump -debug-info %t.o | FileCheck %s --check-prefixes=CHECK,CHECK-DW4,CHECK-TYPE
; RUN: llc -debugger-tune=gdb -dwarf-version=3 -filetype=obj -o %t.o < %s
; RUN: llvm-dwarfdump -debug-info %t.o | FileCheck %s --check-prefixes=CHECK,CHECK-TYPE
-; RUN: llc -debugger-tune=gdb -dwarf-version=2 -filetype=obj -o %t.o < %s
-; RUN: llvm-dwarfdump -debug-info %t.o | FileCheck %s --check-prefixes=CHECK,CHECK-TYPE
-; RUN: llc -debugger-tune=gdb -dwarf-version=2 -strict-dwarf=true -filetype=obj -o %t.o < %s
-; RUN: llvm-dwarfdump -debug-info %t.o | FileCheck %s --check-prefixes=CHECK,CHECK-DW2-STRICT
+
+; This file is also used by the dwarf-version=2 tests in debug-info-enum-dwarf2.ll.
@x0 = global i8 0, align 1, !dbg !0
@x1 = global i8 0, align 1, !dbg !46
diff --git a/llvm/test/DebugInfo/Generic/incorrect-variable-debugloc1-dwarf2.ll b/llvm/test/DebugInfo/Generic/incorrect-variable-debugloc1-dwarf2.ll
new file mode 100644
index 0000000000000..320415cfa1355
--- /dev/null
+++ b/llvm/test/DebugInfo/Generic/incorrect-variable-debugloc1-dwarf2.ll
@@ -0,0 +1,10 @@
+; xfail this test on hexagon because at O2, instructions are bundled in packets
+; and DW_OP_lit13 is correctly omitted.
+; XFAIL: target=hexagon-{{.*}}
+
+; This file contains the dwarf-version=2 tests extracted from incorrect-variable-debugloc1.ll.
+; DWARF v2 is incompatible with 64-bit XCOFF/AIX (requires DWARF64 format which needs DWARF v3+).
+
+; UNSUPPORTED: target=powerpc64{{.*}}-aix{{.*}}
+
+; RUN: %llc_dwarf -O2 -dwarf-version 2 -filetype=obj < %S/incorrect-variable-debugloc1.ll | llvm-dwarfdump - | FileCheck %S/incorrect-variable-debugloc1.ll --check-prefix=DWARF23
diff --git a/llvm/test/DebugInfo/Generic/incorrect-variable-debugloc1.ll b/llvm/test/DebugInfo/Generic/incorrect-variable-debugloc1.ll
index 9399eb7a15637..406ab8d86802a 100644
--- a/llvm/test/DebugInfo/Generic/incorrect-variable-debugloc1.ll
+++ b/llvm/test/DebugInfo/Generic/incorrect-variable-debugloc1.ll
@@ -2,10 +2,11 @@
; and DW_OP_lit13 is correctly omitted.
; XFAIL: target=hexagon-{{.*}}
-; RUN: %llc_dwarf -O2 -dwarf-version 2 -filetype=obj < %s | llvm-dwarfdump - | FileCheck %s --check-prefix=DWARF23
; RUN: %llc_dwarf -O2 -dwarf-version 3 -filetype=obj < %s | llvm-dwarfdump - | FileCheck %s --check-prefix=DWARF23
; RUN: %llc_dwarf -O2 -dwarf-version 4 -filetype=obj < %s | llvm-dwarfdump - | FileCheck %s --check-prefix=DWARF4
+; This file is also used by the dwarf-version=2 tests in incorrect-variable-debugloc1-dwarf2.ll.
+
; This is a test for PR21176.
; DW_OP_const <const> doesn't describe a constant value, but a value at a constant address.
; The proper way to describe a constant value is DW_OP_constu <const>, DW_OP_stack_value.
diff --git a/llvm/test/DebugInfo/Generic/restrict-dwarf2.ll b/llvm/test/DebugInfo/Generic/restrict-dwarf2.ll
new file mode 100644
index 0000000000000..512573ef2e580
--- /dev/null
+++ b/llvm/test/DebugInfo/Generic/restrict-dwarf2.ll
@@ -0,0 +1,6 @@
+; This file contains the dwarf-version=2 tests extracted from restrict.ll.
+; DWARF v2 is incompatible with 64-bit XCOFF/AIX (requires DWARF64 format which needs DWARF v3+).
+
+; UNSUPPORTED: target=powerpc64{{.*}}-aix{{.*}}
+
+; RUN: %llc_dwarf -dwarf-version=2 -O0 -filetype=obj < %S/restrict.ll | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=CHECK --check-prefix=V2 %S/restrict.ll
diff --git a/llvm/test/DebugInfo/Generic/restrict.ll b/llvm/test/DebugInfo/Generic/restrict.ll
index f508ec649d307..a47dffc1072b9 100644
--- a/llvm/test/DebugInfo/Generic/restrict.ll
+++ b/llvm/test/DebugInfo/Generic/restrict.ll
@@ -1,6 +1,7 @@
-; RUN: %llc_dwarf -dwarf-version=2 -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=CHECK --check-prefix=V2 %s
; RUN: %llc_dwarf -dwarf-version=3 -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=CHECK --check-prefix=V3 %s
+; This file is also used by the dwarf-version=2 tests in restrict-dwarf2.ll.
+
; CHECK: DW_AT_name ("dst")
; V2: DW_AT_type ([[PTR:0x........]]
; V3: DW_AT_type ([[RESTRICT:0x........]]
More information about the llvm-commits
mailing list