diff --git a/tests/bugs/Disable-separate-code-for-aarch64/main.fmf b/tests/bugs/Disable-separate-code-for-aarch64/main.fmf new file mode 100644 index 0000000..d4a4d7e --- /dev/null +++ b/tests/bugs/Disable-separate-code-for-aarch64/main.fmf @@ -0,0 +1,6 @@ +summary: Disable separate-code for aarch64 + +duration: 10m + +link+: + - verifies: https://issues.redhat.com/browse/RHEL-42954 diff --git a/tests/bugs/Disable-separate-code-for-aarch64/reproducer.c b/tests/bugs/Disable-separate-code-for-aarch64/reproducer.c new file mode 100644 index 0000000..cf601ce --- /dev/null +++ b/tests/bugs/Disable-separate-code-for-aarch64/reproducer.c @@ -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); } diff --git a/tests/bugs/Disable-separate-code-for-aarch64/test.sh b/tests/bugs/Disable-separate-code-for-aarch64/test.sh new file mode 100755 index 0000000..dfa1578 --- /dev/null +++ b/tests/bugs/Disable-separate-code-for-aarch64/test.sh @@ -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