Add coverage for RHEL-42954
binutils: Disable separate-code for aarch64
This commit is contained in:
parent
fe07b4e4c8
commit
d38c5a7ff5
3 changed files with 42 additions and 0 deletions
6
tests/bugs/Disable-separate-code-for-aarch64/main.fmf
Normal file
6
tests/bugs/Disable-separate-code-for-aarch64/main.fmf
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
summary: Disable separate-code for aarch64
|
||||
|
||||
duration: 10m
|
||||
|
||||
link+:
|
||||
- verifies: https://issues.redhat.com/browse/RHEL-42954
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
extern int printf (const char *, ...);
|
||||
int i = 42;
|
||||
const int * j = & i;
|
||||
|
||||
int main (void) { return printf ("hello world %d\n", * j); }
|
||||
31
tests/bugs/Disable-separate-code-for-aarch64/test.sh
Executable file
31
tests/bugs/Disable-separate-code-for-aarch64/test.sh
Executable file
|
|
@ -0,0 +1,31 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
. "$TMT_TREE/tests/lib.sh" || exit 1
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
buTestHeader
|
||||
buEnterTmpDir
|
||||
|
||||
buCopyReproducers "reproducer.c"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
|
||||
rlRun "gcc -O0 -o reproducer reproducer.c"
|
||||
rlRun "readelf -lW ./reproducer |& tee output"
|
||||
rlAssertEquals "only two LOAD sections are expected" "$(grep "LOAD" output | wc -l)" "2"
|
||||
|
||||
rlRun "gcc -O0 -o reproducer -Wl,-z,separate-code reproducer.c"
|
||||
rlRun "readelf -lW ./reproducer |& tee output"
|
||||
rlAssertEquals "four LOAD sections are expected" "$(grep "LOAD" output | wc -l)" "4"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
buExitTmpDir
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
Loading…
Add table
Add a link
Reference in a new issue