Skip to content

Commit fe83acc

Browse files
authored
[AIX] Enable tests relating to 64-bit XCOFF object files (#71814)
We now have 64-bit XCOFF object file support, so these tests can be enabled again. However, some tests still fail due to unsupported debug sections, so I cleaned up their comments.
1 parent a1e1c24 commit fe83acc

File tree

4 files changed

+28
-262
lines changed

4 files changed

+28
-262
lines changed

clang/test/lit.cfg.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -332,43 +332,6 @@ def calculate_arch_features(arch_string):
332332
config.available_features.add("llvm-driver")
333333

334334

335-
def exclude_unsupported_files_for_aix(dirname):
336-
for filename in os.listdir(dirname):
337-
source_path = os.path.join(dirname, filename)
338-
if os.path.isdir(source_path):
339-
continue
340-
f = open(source_path, "r", encoding="ISO-8859-1")
341-
try:
342-
data = f.read()
343-
# 64-bit object files are not supported on AIX, so exclude the tests.
344-
if (
345-
any(
346-
option in data
347-
for option in (
348-
"-emit-obj",
349-
"-fmodule-format=obj",
350-
"-fintegrated-as",
351-
)
352-
)
353-
and "64" in config.target_triple
354-
):
355-
config.excludes += [filename]
356-
finally:
357-
f.close()
358-
359-
360-
if "aix" in config.target_triple:
361-
for directory in (
362-
"/CodeGenCXX",
363-
"/Misc",
364-
"/Modules",
365-
"/PCH",
366-
"/Driver",
367-
"/ASTMerge/anonymous-fields",
368-
"/ASTMerge/injected-class-name-decl",
369-
):
370-
exclude_unsupported_files_for_aix(config.test_source_root + directory)
371-
372335
# Some tests perform deep recursion, which requires a larger pthread stack size
373336
# than the relatively low default of 192 KiB for 64-bit processes on AIX. The
374337
# `AIXTHREAD_STK` environment variable provides a non-intrusive way to request

llvm/test/lit.cfg.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -601,34 +601,6 @@ def have_ld64_plugin_support():
601601
config.available_features.add("use_msan_with_origins")
602602

603603

604-
def exclude_unsupported_files_for_aix(dirname):
605-
for filename in os.listdir(dirname):
606-
source_path = os.path.join(dirname, filename)
607-
if os.path.isdir(source_path):
608-
continue
609-
f = open(source_path, "r")
610-
try:
611-
data = f.read()
612-
# 64-bit object files are not supported on AIX, so exclude the tests.
613-
if (
614-
"-emit-obj" in data or "-filetype=obj" in data
615-
) and "64" in config.target_triple:
616-
config.excludes += [filename]
617-
finally:
618-
f.close()
619-
620-
621-
if "aix" in config.target_triple:
622-
for directory in (
623-
"/CodeGen/X86",
624-
"/DebugInfo",
625-
"/DebugInfo/X86",
626-
"/DebugInfo/Generic",
627-
"/LTO/X86",
628-
"/Linker",
629-
):
630-
exclude_unsupported_files_for_aix(config.test_source_root + directory)
631-
632604
# Some tools support an environment variable "OBJECT_MODE" on AIX OS, which
633605
# controls the kind of objects they will support. If there is no "OBJECT_MODE"
634606
# environment variable specified, the default behaviour is to support 32-bit

llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp

Lines changed: 13 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
#include "gtest/gtest.h"
3434
#include <string>
3535

36+
// AIX doesn't support debug_str_offsets or debug_addr sections
37+
#ifdef _AIX
38+
#define NO_SUPPORT_DEBUG_STR_OFFSETS
39+
#define NO_SUPPORT_DEBUG_ADDR
40+
#endif
41+
3642
using namespace llvm;
3743
using namespace dwarf;
3844
using namespace utils;
@@ -435,11 +441,7 @@ TEST(DWARFDebugInfo, TestDWARF32Version2Addr4AllForms) {
435441
TestAllForms<2, AddrType, RefAddrType>();
436442
}
437443

438-
#ifdef _AIX
439-
TEST(DWARFDebugInfo, DISABLED_TestDWARF32Version2Addr8AllForms) {
440-
#else
441444
TEST(DWARFDebugInfo, TestDWARF32Version2Addr8AllForms) {
442-
#endif
443445
// Test that we can decode all forms for DWARF32, version 2, with 4 byte
444446
// addresses.
445447
typedef uint64_t AddrType;
@@ -457,11 +459,7 @@ TEST(DWARFDebugInfo, TestDWARF32Version3Addr4AllForms) {
457459
TestAllForms<3, AddrType, RefAddrType>();
458460
}
459461

460-
#ifdef _AIX
461-
TEST(DWARFDebugInfo, DISABLED_TestDWARF32Version3Addr8AllForms) {
462-
#else
463462
TEST(DWARFDebugInfo, TestDWARF32Version3Addr8AllForms) {
464-
#endif
465463
// Test that we can decode all forms for DWARF32, version 3, with 8 byte
466464
// addresses.
467465
typedef uint64_t AddrType;
@@ -479,11 +477,7 @@ TEST(DWARFDebugInfo, TestDWARF32Version4Addr4AllForms) {
479477
TestAllForms<4, AddrType, RefAddrType>();
480478
}
481479

482-
#ifdef _AIX
483-
TEST(DWARFDebugInfo, DISABLED_TestDWARF32Version4Addr8AllForms) {
484-
#else
485480
TEST(DWARFDebugInfo, TestDWARF32Version4Addr8AllForms) {
486-
#endif
487481
// Test that we can decode all forms for DWARF32, version 4, with 8 byte
488482
// addresses.
489483
typedef uint64_t AddrType;
@@ -492,8 +486,8 @@ TEST(DWARFDebugInfo, TestDWARF32Version4Addr8AllForms) {
492486
TestAllForms<4, AddrType, RefAddrType>();
493487
}
494488

495-
#ifdef _AIX
496-
TEST(DWARFDebigInfo, DISABLED_TestDWARF32Version5Addr4AllForms) {
489+
#ifdef NO_SUPPORT_DEBUG_STR_OFFSETS
490+
TEST(DWARFDebugInfo, DISABLED_TestDWARF32Version5Addr4AllForms) {
497491
#else
498492
TEST(DWARFDebugInfo, TestDWARF32Version5Addr4AllForms) {
499493
#endif
@@ -505,8 +499,8 @@ TEST(DWARFDebugInfo, TestDWARF32Version5Addr4AllForms) {
505499
TestAllForms<5, AddrType, RefAddrType>();
506500
}
507501

508-
#ifdef _AIX
509-
TEST(DWARFDebigInfo, DISABLED_TestDWARF32Version5Addr8AllForms) {
502+
#ifdef NO_SUPPORT_DEBUG_STR_OFFSETS
503+
TEST(DWARFDebugInfo, DISABLED_TestDWARF32Version5Addr8AllForms) {
510504
#else
511505
TEST(DWARFDebugInfo, TestDWARF32Version5Addr8AllForms) {
512506
#endif
@@ -613,11 +607,7 @@ TEST(DWARFDebugInfo, TestDWARF32Version2Addr4Children) {
613607
TestChildren<2, AddrType>();
614608
}
615609

616-
#ifdef _AIX
617-
TEST(DWARFDebugInfo, DISABLED_TestDWARF32Version2Addr8Children) {
618-
#else
619610
TEST(DWARFDebugInfo, TestDWARF32Version2Addr8Children) {
620-
#endif
621611
// Test that we can decode all forms for DWARF32, version 2, with 8 byte
622612
// addresses.
623613
typedef uint64_t AddrType;
@@ -631,11 +621,7 @@ TEST(DWARFDebugInfo, TestDWARF32Version3Addr4Children) {
631621
TestChildren<3, AddrType>();
632622
}
633623

634-
#ifdef _AIX
635-
TEST(DWARFDebugInfo, DISABLED_TestDWARF32Version3Addr8Children) {
636-
#else
637624
TEST(DWARFDebugInfo, TestDWARF32Version3Addr8Children) {
638-
#endif
639625
// Test that we can decode all forms for DWARF32, version 3, with 8 byte
640626
// addresses.
641627
typedef uint64_t AddrType;
@@ -649,11 +635,7 @@ TEST(DWARFDebugInfo, TestDWARF32Version4Addr4Children) {
649635
TestChildren<4, AddrType>();
650636
}
651637

652-
#ifdef _AIX
653-
TEST(DWARFDebugInfo, DISABLED_TestDWARF32Version4Addr8Children) {
654-
#else
655638
TEST(DWARFDebugInfo, TestDWARF32Version4Addr8Children) {
656-
#endif
657639
// Test that we can decode all forms for DWARF32, version 4, with 8 byte
658640
// addresses.
659641
typedef uint64_t AddrType;
@@ -875,11 +857,7 @@ TEST(DWARFDebugInfo, TestDWARF32Version2Addr4References) {
875857
TestReferences<2, AddrType>();
876858
}
877859

878-
#ifdef _AIX
879-
TEST(DWARFDebugInfo, DISABLED_TestDWARF32Version2Addr8References) {
880-
#else
881860
TEST(DWARFDebugInfo, TestDWARF32Version2Addr8References) {
882-
#endif
883861
// Test that we can decode all forms for DWARF32, version 2, with 8 byte
884862
// addresses.
885863
typedef uint64_t AddrType;
@@ -893,11 +871,7 @@ TEST(DWARFDebugInfo, TestDWARF32Version3Addr4References) {
893871
TestReferences<3, AddrType>();
894872
}
895873

896-
#ifdef _AIX
897-
TEST(DWARFDebugInfo, DISABLED_TestDWARF32Version3Addr8References) {
898-
#else
899874
TEST(DWARFDebugInfo, TestDWARF32Version3Addr8References) {
900-
#endif
901875
// Test that we can decode all forms for DWARF32, version 3, with 8 byte
902876
// addresses.
903877
typedef uint64_t AddrType;
@@ -911,11 +885,7 @@ TEST(DWARFDebugInfo, TestDWARF32Version4Addr4References) {
911885
TestReferences<4, AddrType>();
912886
}
913887

914-
#ifdef _AIX
915-
TEST(DWARFDebugInfo, DISABLED_TestDWARF32Version4Addr8References) {
916-
#else
917888
TEST(DWARFDebugInfo, TestDWARF32Version4Addr8References) {
918-
#endif
919889
// Test that we can decode all forms for DWARF32, version 4, with 8 byte
920890
// addresses.
921891
typedef uint64_t AddrType;
@@ -1059,11 +1029,7 @@ TEST(DWARFDebugInfo, TestDWARF32Version2Addr4Addresses) {
10591029
TestAddresses<2, AddrType>();
10601030
}
10611031

1062-
#ifdef _AIX
1063-
TEST(DWARFDebugInfo, DISABLED_TestDWARF32Version2Addr8Addresses) {
1064-
#else
10651032
TEST(DWARFDebugInfo, TestDWARF32Version2Addr8Addresses) {
1066-
#endif
10671033
// Test that we can decode address values in DWARF32, version 2, with 8 byte
10681034
// addresses.
10691035
typedef uint64_t AddrType;
@@ -1077,11 +1043,7 @@ TEST(DWARFDebugInfo, TestDWARF32Version3Addr4Addresses) {
10771043
TestAddresses<3, AddrType>();
10781044
}
10791045

1080-
#ifdef _AIX
1081-
TEST(DWARFDebugInfo, DISABLED_TestDWARF32Version3Addr8Addresses) {
1082-
#else
10831046
TEST(DWARFDebugInfo, TestDWARF32Version3Addr8Addresses) {
1084-
#endif
10851047
// Test that we can decode address values in DWARF32, version 3, with 8 byte
10861048
// addresses.
10871049
typedef uint64_t AddrType;
@@ -1095,18 +1057,14 @@ TEST(DWARFDebugInfo, TestDWARF32Version4Addr4Addresses) {
10951057
TestAddresses<4, AddrType>();
10961058
}
10971059

1098-
#ifdef _AIX
1099-
TEST(DWARFDebugInfo, DISABLED_TestDWARF32Version4Addr8Addresses) {
1100-
#else
11011060
TEST(DWARFDebugInfo, TestDWARF32Version4Addr8Addresses) {
1102-
#endif
11031061
// Test that we can decode address values in DWARF32, version 4, with 8 byte
11041062
// addresses.
11051063
typedef uint64_t AddrType;
11061064
TestAddresses<4, AddrType>();
11071065
}
11081066

1109-
#ifdef _AIX
1067+
#ifdef NO_SUPPORT_DEBUG_STR_OFFSETS
11101068
TEST(DWARFDebugInfo, DISABLED_TestStringOffsets) {
11111069
#else
11121070
TEST(DWARFDebugInfo, TestStringOffsets) {
@@ -1175,8 +1133,7 @@ TEST(DWARFDebugInfo, TestStringOffsets) {
11751133
EXPECT_STREQ(String1, *Extracted3);
11761134
}
11771135

1178-
// AIX does not support string offset section.
1179-
#if defined(_AIX)
1136+
#ifdef NO_SUPPORT_DEBUG_ADDR
11801137
TEST(DWARFDebugInfo, DISABLED_TestEmptyStringOffsets) {
11811138
#else
11821139
TEST(DWARFDebugInfo, TestEmptyStringOffsets) {
@@ -1845,8 +1802,7 @@ TEST(DWARFDebugInfo, TestFindAttrs) {
18451802
EXPECT_EQ(DieMangled, toString(NameOpt, ""));
18461803
}
18471804

1848-
// AIX does not support debug_addr section.
1849-
#if defined(_AIX)
1805+
#ifdef NO_SUPPORT_DEBUG_ADDR
18501806
TEST(DWARFDebugInfo, DISABLED_TestImplicitConstAbbrevs) {
18511807
#else
18521808
TEST(DWARFDebugInfo, TestImplicitConstAbbrevs) {

0 commit comments

Comments
 (0)