This is an archive of the discontinued LLVM Phabricator instance.

[Orc] Enable debug object tests only on x86_64 hosts
ClosedPublic

Authored by sgraenitz on Aug 6 2021, 5:47 AM.

Details

Summary

These tests rely on running IR code with an explicit x86_64 target triple. They won't work on other architectures. (They won't work for 32-bit processes on x86_64 hosts either. We will take care of this later.)

Diff Detail

Event Timeline

sgraenitz created this revision.Aug 6 2021, 5:47 AM
sgraenitz requested review of this revision.Aug 6 2021, 5:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 6 2021, 5:47 AM
mgorny added inline comments.Aug 7 2021, 4:53 AM
llvm/test/ExecutionEngine/OrcLazy/debug-objects-elf-minimal.ll
2–3

This correctly skips the test on i386 builds for me, and runs it on amd64 builds. Also note that you need to use ; as the comment character, as otherwise lli errors out.

llvm/test/ExecutionEngine/OrcLazy/lit.local.cfg
11 ↗(On Diff #364761)

This doesn't seem to be correct. On my amd64 system, I get (with Python 3.6 through 3.10):

>>> import sys
>>> sys.int_info
sys.int_info(bits_per_digit=30, sizeof_digit=4)

Even if it worked, it wouldn't be the correct thing to do. It's common to use 64-bit Python on multilib systems where LLVM is 32-bit.

Given your earlier input, wouldn't it be sufficient to restrict the test to x86_64?

mgorny added a comment.Aug 7 2021, 7:24 AM

Just to confirm, the test suite passes for me (both i386 and amd64 build) with the following diff:

diff --git a/llvm/test/ExecutionEngine/OrcLazy/debug-descriptor-elf-minimal.ll b/llvm/test/ExecutionEngine/OrcLazy/debug-descriptor-elf-minimal.ll
index 1c17edb337a1..a8781a84bb7b 100644
--- a/llvm/test/ExecutionEngine/OrcLazy/debug-descriptor-elf-minimal.ll
+++ b/llvm/test/ExecutionEngine/OrcLazy/debug-descriptor-elf-minimal.ll
@@ -1,3 +1,5 @@
+; REQUIRES: x86_64
+
 ; RUN: lli --jit-kind=orc-lazy --per-module-lazy --jit-linker=rtdyld \
 ; RUN:     --generate=__dump_jit_debug_descriptor %s | FileCheck %s
 ;
diff --git a/llvm/test/ExecutionEngine/OrcLazy/debug-objects-elf-minimal.ll b/llvm/test/ExecutionEngine/OrcLazy/debug-objects-elf-minimal.ll
index 3bf1a98268f9..85c1215c6884 100644
--- a/llvm/test/ExecutionEngine/OrcLazy/debug-objects-elf-minimal.ll
+++ b/llvm/test/ExecutionEngine/OrcLazy/debug-objects-elf-minimal.ll
@@ -1,3 +1,5 @@
+; REQUIRES: x86_64
+
 ; In-memory debug-object contains some basic DWARF
 ;
 ; RUN: lli --jit-kind=orc-lazy --per-module-lazy --jit-linker=rtdyld \

Just to confirm, the test suite passes for me (both i386 and amd64 build) with the following diff

Great, let's take that for the moment and I will have a look at the 32-bit on x86_64 once I find the time towards the end of the month.

llvm/test/ExecutionEngine/OrcLazy/debug-objects-elf-minimal.ll
2–3

Right, we'll need ;. I didn't double-check in a regular build.

llvm/test/ExecutionEngine/OrcLazy/lit.local.cfg
11 ↗(On Diff #364761)

Right, the guess that this might refer to the bitness of the compile target was hurried. It's obviously not. I will see whether or not this info is available at LIT config time elsewhere.

Given your earlier input, wouldn't it be sufficient to restrict the test to x86_64?

I guess in your case it's sufficient, yes. In my repro, however, I build with LLVM_BUILD_32_BITS on a x86_64 host and the test would still run.

sgraenitz updated this revision to Diff 365704.Aug 11 2021, 3:03 AM
sgraenitz marked 2 inline comments as done.

For the moment ignore 32-bit on x86_64

sgraenitz retitled this revision from [Orc] Enable debug object tests only for 64-bit processes on x86_64 hosts to [Orc] Enable debug object tests only on x86_64 hosts.Aug 11 2021, 3:07 AM
sgraenitz edited the summary of this revision. (Show Details)
This revision was not accepted when it landed; it landed in state Needs Review.Aug 11 2021, 3:10 AM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.