Skip to content

Commit 4fd6b32

Browse files
rorthtru
authored andcommitted
[llvm-exegesis][unittests] Also disable SubprocessMemoryTest on SPARC (llvm#102755)
Three `llvm-exegesis` tests ``` LLVM-Unit :: tools/llvm-exegesis/./LLVMExegesisTests/SubprocessMemoryTest/DefinitionFillsCompletely LLVM-Unit :: tools/llvm-exegesis/./LLVMExegesisTests/SubprocessMemoryTest/MultipleDefinitions LLVM-Unit :: tools/llvm-exegesis/./LLVMExegesisTests/SubprocessMemoryTest/OneDefinition ``` `FAIL` on Linux/sparc64 like ``` llvm/unittests/tools/llvm-exegesis/X86/SubprocessMemoryTest.cpp:68: Failure Expected equality of these values: SharedMemoryMapping[I] Which is: '\0' ExpectedValue[I] Which is: '\xAA' (170) ``` It seems like this test only works on little-endian hosts: three sub-tests are already disabled on powerpc and s390x (both big-endian), and the fourth is additionally guarded against big-endian hosts (making the other guards unnecessary). However, since it's not been analyzed if this is really an endianess issue, this patch disables the whole test on powerpc and s390x as before adding sparc to the mix. Tested on `sparc64-unknown-linux-gnu` and `x86_64-pc-linux-gnu`. (cherry picked from commit a417083)
1 parent f638198 commit 4fd6b32

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

llvm/unittests/tools/llvm-exegesis/X86/SubprocessMemoryTest.cpp

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
namespace llvm {
2525
namespace exegesis {
2626

27-
#if defined(__linux__) && !defined(__ANDROID__)
27+
#if defined(__linux__) && !defined(__ANDROID__) && \
28+
!(defined(__powerpc__) || defined(__s390x__) || defined(__sparc__))
2829

2930
// This needs to be updated anytime a test is added or removed from the test
3031
// suite.
@@ -77,20 +78,12 @@ class SubprocessMemoryTest : public X86TestBase {
7778
// memory calls not working in some cases, so they have been disabled.
7879
// TODO(boomanaiden154): Investigate and fix this issue on PPC.
7980

80-
#if defined(__powerpc__) || defined(__s390x__)
81-
TEST_F(SubprocessMemoryTest, DISABLED_OneDefinition) {
82-
#else
8381
TEST_F(SubprocessMemoryTest, OneDefinition) {
84-
#endif
8582
testCommon({{"test1", {APInt(8, 0xff), 4096, 0}}}, 0);
8683
checkSharedMemoryDefinition(getSharedMemoryName(0, 0), 4096, {0xff});
8784
}
8885

89-
#if defined(__powerpc__) || defined(__s390x__)
90-
TEST_F(SubprocessMemoryTest, DISABLED_MultipleDefinitions) {
91-
#else
9286
TEST_F(SubprocessMemoryTest, MultipleDefinitions) {
93-
#endif
9487
testCommon({{"test1", {APInt(8, 0xaa), 4096, 0}},
9588
{"test2", {APInt(8, 0xbb), 4096, 1}},
9689
{"test3", {APInt(8, 0xcc), 4096, 2}}},
@@ -100,11 +93,7 @@ TEST_F(SubprocessMemoryTest, MultipleDefinitions) {
10093
checkSharedMemoryDefinition(getSharedMemoryName(1, 2), 4096, {0xcc});
10194
}
10295

103-
#if defined(__powerpc__) || defined(__s390x__)
104-
TEST_F(SubprocessMemoryTest, DISABLED_DefinitionFillsCompletely) {
105-
#else
10696
TEST_F(SubprocessMemoryTest, DefinitionFillsCompletely) {
107-
#endif
10897
testCommon({{"test1", {APInt(8, 0xaa), 4096, 0}},
10998
{"test2", {APInt(16, 0xbbbb), 4096, 1}},
11099
{"test3", {APInt(24, 0xcccccc), 4096, 2}}},
@@ -118,7 +107,7 @@ TEST_F(SubprocessMemoryTest, DefinitionFillsCompletely) {
118107
}
119108

120109
// The following test is only supported on little endian systems.
121-
#if defined(__powerpc__) || defined(__s390x__) || __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
110+
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
122111
TEST_F(SubprocessMemoryTest, DISABLED_DefinitionEndTruncation) {
123112
#else
124113
TEST_F(SubprocessMemoryTest, DefinitionEndTruncation) {
@@ -150,7 +139,7 @@ TEST_F(SubprocessMemoryTest, DefinitionEndTruncation) {
150139
checkSharedMemoryDefinition(getSharedMemoryName(3, 0), 4096, Test1Expected);
151140
}
152141

153-
#endif // defined(__linux__) && !defined(__ANDROID__)
142+
#endif // __linux__ && !__ANDROID__ && !(__powerpc__ || __s390x__ || __sparc__)
154143

155144
} // namespace exegesis
156145
} // namespace llvm

0 commit comments

Comments
 (0)