public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Andrej Cernek <acernek@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/gcc] rhel-f41-base: test-m32-m54-options: manage dependencies in fmf file
Date: Mon, 29 Jun 2026 12:30:10 GMT	[thread overview]
Message-ID: <178273621076.1.8317156955452409465.rpms-gcc-85fff34818f2@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/gcc
            Branch : rhel-f41-base
            Commit : 85fff34818f25219aec1a286dd1f9bf2af6c9448
            Author : Andrej Cernek <acernek@redhat.com>
            Date   : 2023-03-28T14:39:35+00:00
            Stats  : +150/-189 in 4 file(s)
            URL    : https://src.fedoraproject.org/rpms/gcc/c/85fff34818f25219aec1a286dd1f9bf2af6c9448?branch=rhel-f41-base

            Log:
            test-m32-m54-options: manage dependencies in fmf file

Also include updated script from the RHEL tests and fixes for rawhide.
Note: dependencies were configured for x86_64 only.

---
diff --git a/tests/Sanity/test-m32-m64-options/cpp11.cpp b/tests/Sanity/test-m32-m64-options/cpp11.cpp
index 649daec..0d57b57 100644
--- a/tests/Sanity/test-m32-m64-options/cpp11.cpp
+++ b/tests/Sanity/test-m32-m64-options/cpp11.cpp
@@ -3,7 +3,7 @@ class X
 {
   T p;
 public:
-  template <class U> auto f() -> decltype(+p) { }
+  template <class U> auto f() -> decltype(+p) { return p; }
 };
 
 struct A

diff --git a/tests/Sanity/test-m32-m64-options/lambda-template.C b/tests/Sanity/test-m32-m64-options/lambda-template.C
index b4db3b8..6f3b4e8 100644
--- a/tests/Sanity/test-m32-m64-options/lambda-template.C
+++ b/tests/Sanity/test-m32-m64-options/lambda-template.C
@@ -10,7 +10,7 @@ auto apply (T t) -> decltype (t())
 }
 
 template <class T>
-T f(T t)
+void f(T t)
 {
   T t2 = t;
   if (t != [=]()->T { return t; }())

diff --git a/tests/Sanity/test-m32-m64-options/main.fmf b/tests/Sanity/test-m32-m64-options/main.fmf
index 04472ac..cef912f 100644
--- a/tests/Sanity/test-m32-m64-options/main.fmf
+++ b/tests/Sanity/test-m32-m64-options/main.fmf
@@ -1,5 +1,5 @@
 summary: Try -m32 and -m64 options.
-description: ''
+description: Try -m32 and -m64 options
 contact: mcermak@redhat.com
 component:
   - gcc
@@ -10,20 +10,16 @@ require:
   - gcc
   - gcc-c++
   - gcc-gfortran
-  - glibc-common
-  - libgcc
-  - libgomp
+  - glibc-devel
   - libgfortran
-  - libstdc++
+  - libgomp
   - libstdc++-devel
-  - glibc-devel
   - libitm
 recommend:
-  - libgfortran44.i686
-  - libgfortran44.x86_64
-  - libgfortran4.i686
-  - libgfortran4.x86_64
-duration: 10m
+  - libgfortran5
+  - libitm-devel
+  - libquadmath-devel
+duration: 20m
 enabled: true
 link:
   - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1113429
@@ -31,21 +27,32 @@ adjust:
   - enabled: false
     when: arch == ia64, ppc64, s390, s390x
     continue: false
+  - enabled: false
+    when: arch == aarch64
+    continue: false
+    because: no -m64 nor -m32 there
   - require+:
-    - glibc-devel.i686
     - glibc-devel.x86_64
-    - libgcc.i686
-    - libgcc.x86_64
-    - libgfortran.i686
+    - glibc-devel.i686
     - libgfortran.x86_64
-    - libgomp.i686
-    - libgomp.x86_64
-    - libitm.i686
+    - libgfortran.i686
+    - libstdc++-devel.x86_64
+    - libstdc++-devel.i686
     - libitm.x86_64
-    - libstdc++.i686
-    - libstdc++.x86_64
+    - libitm.i686
+    - libgomp.x86_64
+    - libgomp.i686
+    - libquadmath.x86_64
+    - libquadmath.i686
+    when: arch == x86_64
+  - recommend+:
+    - libgfortran5.x86_64
+    - libgfortran5.i686
+    - libitm-devel.x86_64
+    - libitm-devel.i686
+    - libquadmath-devel.x86_64
+    - libquadmath-devel.i686
     when: arch == x86_64
-    continue: false
 extra-nitrate: TC#0197178
 extra-summary: /tools/gcc/Sanity/test-m32-m64-options
 extra-task: /tools/gcc/Sanity/test-m32-m64-options

diff --git a/tests/Sanity/test-m32-m64-options/runtest.sh b/tests/Sanity/test-m32-m64-options/runtest.sh
index 15e99af..31b8241 100755
--- a/tests/Sanity/test-m32-m64-options/runtest.sh
+++ b/tests/Sanity/test-m32-m64-options/runtest.sh
@@ -26,188 +26,142 @@
 #
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-# This is for Toolset.
-#
 # In this test, we try to compile and run programs using -m32 and -m64.
 # We compile C, C++ and Fortran Hello World programs.  Also, there are two 
 # proglets which are exercising some C++11 features.  Furthermore, we try
 # -fgnu-tm,  -fopenmp options.  We also use libquadmath a little bit.
 # We call a function from libgcc.  We also use the __thread keyword.
-# Everything should be ok when running under e.g.:
-#   scl enable devtoolset-1.0 bash
-# Note, that gfortran is not a part of 1.0 release.
 
 # Include Beaker environment
 . /usr/share/beakerlib/beakerlib.sh || exit 1
 
-PACKAGES=(gcc gcc-c++ gcc-gfortran glibc-common libgcc libgomp libgfortran glibc-devel libitm)
-
-PACKAGES_X86_64=(libgomp libgfortran glibc-devel libgcc libitm)
+GCC=${GCC:-$(type -P gcc)}
+GCC_RPM_NAME=$(rpm --qf '%{name}' -qf $GCC)
 
-# Choose the compiler.
-GCC=${GCC:-gcc}
-GXX=${GXX:-g++}
-GFORTRAN=${GFORTRAN:-gfortran}
+[[ "$GCC_RPM_NAME" == *toolset* ]] && TOOLSET=${GCC_RPM_NAME%-gcc} || TOOLSET=''
 
-PACKAGE=$GCC
-
-# Set the variabile UNDER_DTS on non-empty string, when run under devtoolset
-if $( echo `which gcc` | grep -qE '/opt/rh/' ); then
-  UNDER_DTS="true"
-  # Set the actual version of DTS
-  DTS=`which gcc | awk 'BEGIN { FS="/" } { print $4 }'`
+if [ -n "`rlGetPrimaryArch`" ]; then
+    PRI_ARCH=$(rlGetPrimaryArch)
+else
+    PRI_ARCH="$(uname -i)"
 fi
 
-rlJournalStart
-  rlPhaseStartSetup
-    for p in "${PACKAGES[@]}"; do
-      rpm -q "$p" || yum install -y $p
-      rlAssertRpm "$p"
-    done; unset p
-    yum update -y libitm # this is a hack, since libitm is a troublemaker
-    if [ -n "`rlGetSecondaryArch`" ]; then
-      rlCheckRpm "libitm.`rlGetSecondaryArch`" || yum install -y libitm.`rlGetSecondaryArch`
-      rlAssertRpm "libitm.`rlGetSecondaryArch`"
-    fi
-
-    rlCheckRpm "libstdc++-devel.`rlGetPrimaryArch`" || yum install -y libstdc++-devel.`rlGetPrimaryArch`
-    rlAssertRpm "libstdc++-devel.`rlGetPrimaryArch`"
-    # RHEL-8 CI debugging hack (to be removed when not needed):
-    rlRun "rpmquery -l libstdc++-devel.`rlGetPrimaryArch` | grep -e bits/c++config"
-    rlRun "rpmquery -l libstdc++-devel.`rlGetPrimaryArch` | grep -e iostream"
-
-    if [ -n "`rlGetSecondaryArch`" ]; then
-      rlCheckRpm "libitm.`rlGetSecondaryArch`" || yum install -y libitm.`rlGetSecondaryArch`
-      rlAssertRpm "libitm.`rlGetSecondaryArch`"
-    fi
-
-    if [ ! -z ${UNDER_DTS} ]; then
-      rlCheckRpm "$DTS-libstdc++-devel" || yum install -y $DTS-libstdc++-devel
-      rlAssertRpm "$DTS-libstdc++-devel"
-      if [ "`arch`" = 'x86_64' ]; then
-        rlCheckRpm "$DTS-libquadmath-devel" || yum install -y $DTS-libquadmath-devel
-        rlAssertRpm "$DTS-libquadmath-devel"
-      fi
-      if rlIsRHEL '<=7'; then # no libgfortran[45] on RHEL8+
-        rlCheckRpm "libgfortran4" || yum install -y libgfortran4
-        if [ -n "`rlGetSecondaryArch`" ]; then
-          rlCheckRpm "libgfortran4.`rlGetSecondaryArch`" || yum install -y libgfortran4.`rlGetSecondaryArch`
-          rlAssertRpm "libgfortran4.`rlGetSecondaryArch`"
+# State applicable -m<bits> switches
+SWITCHES='-m64 -m32'
+case "$PRI_ARCH" in
+    i686)
+        SWITCHES=-m32 # just base RHEL-6/i386
+        ;;
+    ppc64le) # we never had 32 support there
+        SWITCHES=-m64
+        ;;
+    aarch64)
+        # Not only we never had 32-bit support there, GCC on this architecture
+        # doesn't accept the -m64 switch either. This test isn't applicable
+        # at all and should be excluded by its relevancy, e.g. in TCMS:
+        #   arch = aarch64: False
+        exit 1
+        ;;
+    ppc64|s390x) # 32-bit support present only in system GCC of RHEL <8
+        if [[ -z "$TOOLSET" ]] && rlIsRHEL '<8'; then
+            if [[ "$PRI_ARCH" != s390x ]]; then
+                SWITCHES='-m64 -m32'
+            else
+                SWITCHES='-m64 -m31'
+            fi
+        else
+            SWITCHES=-m64
         fi
-        rlCheckRpm "libgfortran5" || yum install -y libgfortran5
-        rlAssertRpm "libgfortran5" && yum -y update libgfortran5
-        if [ -n "`rlGetSecondaryArch`" ]; then
-          rlCheckRpm "libgfortran5.`rlGetSecondaryArch`" || yum install -y libgfortran5.`rlGetSecondaryArch`
-          rlAssertRpm "libgfortran5.`rlGetSecondaryArch`"
+        ;;
+esac
+
+rlJournalStart
+    rlPhaseStartSetup
+        rlLogInfo "COLLECTIONS=$COLLECTIONS"
+        rlLogInfo "GCC=$GCC"
+        rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK"
+
+        # We optionally need to skip checking for the presence of the metapackage
+        # because that would pull in all the dependent toolset subrpms.  We do not
+        # always want that, especially in CI.
+        _COLLECTIONS="$COLLECTIONS"
+        if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then
+            for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do
+                rlLogInfo "ignoring metapackage check for collection $c"
+                export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/})
+            done
         fi
-      fi
-    fi
-
-    # Check whether on rhel6 x86_64 i686-packages are installed too.
-    # On rhel5 i386-packages should be already installed.
-    if [ "$(uname -i)" == "x86_64" ]; then
-      for pack in "${PACKAGES_X86_64[@]}"; do
-        rpm -q ${pack}.i?86 || yum install -y ${pack}.i?86
-      done; unset pack
-
-      if [ ! -z ${UNDER_DTS} ]; then
-        yum install -y $DTS-libstdc++-devel.i?86
-        yum install -y $DTS-libquadmath-devel.i?86
-      fi
-    fi
-
-    rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
-    # We need some files.
-    rlRun "cp -v hello.{c,cpp,f90} tm.c quad.c thr-init-2.c \
-    clear_cache.c omphello.c lambda-template.C cpp11.cpp $TmpDir"
-    rlRun "pushd $TmpDir"
-  rlPhaseEnd
-
-  rlPhaseStartSetup "Showing compiler versions"
-    for compiler in $GCC $GXX $GFORTRAN
-    do
-      rlLog "Version of compiler: $compiler"
-      eval "$compiler --version 2>&1" | while read line
-      do
-        rlLog "  $line"
-      done
+        rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS"
+        export COLLECTIONS="$_COLLECTIONS"
+
+        rlRun "TmpDir=\$(mktemp -d)"
+        rlRun "cp -v hello.{c,cpp,f90} tm.c quad.c thr-init-2.c clear_cache.c omphello.c lambda-template.C cpp11.cpp $TmpDir"
+        rlRun "pushd $TmpDir"
+    rlPhaseEnd
+
+    rlPhaseStartSetup "Showing compiler versions"
+        for compiler in gcc g++ gfortran; do
+            rlLogInfo "Version of compiler: $compiler"
+            eval "$compiler --version 2>&1" | while read line; do
+                rlLogInfo "  $line"
+            done
+        done
+    rlPhaseEnd
+
+    for m in $SWITCHES; do
+        rlPhaseStartTest "Compile and run [$m]"
+
+            # Test C
+            rlRun "gcc $m hello.c -o hello_c"
+            rlRun ./hello_c
+
+            # Test C++
+            rlRun "g++ $m hello.cpp -o hello_cpp"
+            rlRun ./hello_cpp
+
+            # C++11 features. Not available in system GCC of RHEL-6
+            if ! rlIsRHEL 6 || [[ -n "$TOOLSET" ]]; then
+                rlRun "g++ $m -std=c++11 lambda-template.C -o lambda"
+                rlRun ./lambda
+
+                rlRun "g++ $m -std=c++11 cpp11.cpp -o cpp11"
+                rlRun ./cpp11
+            fi
+
+            # Test Fortran
+            rlRun "gfortran $m hello.f90 -o hello_fortran"
+            rlRun "./hello_fortran"
+
+            # Test TM. Not available in system GCC of RHEL-6
+            if ! rlIsRHEL 6 || [[ -n "$TOOLSET" ]]; then
+                rlRun "gcc $m -O2 -std=gnu99 -fgnu-tm tm.c -o tm"
+                rlRun ./tm
+            fi
+
+            # Test OpenMP
+            rlRun "gcc $m omphello.c -O2 -std=gnu99 -fopenmp -o omp"
+            rlRun ./omp
+
+            # Test __thread
+            rlRun "gcc $m thr-init-2.c -O2 -std=gnu99 -ftls-model=initial-exec -o thr"
+            rlRun ./thr
+
+            # Now test some libquadmath stuff (__float128 support).
+            if rpm -q ${GCC_RPM_NAME%%gcc}libquadmath-devel &>/dev/null; then
+                rlRun "gcc $m quad.c -O2 -std=gnu99 -lquadmath -o quad -lm"
+                rlRun ./quad
+            fi
+
+            # And now something from libgcc, e.g. __builtin___clear_cache.
+            rlRun "gcc $m clear_cache.c -O2 -std=gnu99 -o cache"
+            rlRun ./cache
+
+        rlPhaseEnd
     done
-  rlPhaseEnd
-
-ARCH="$(uname -i)"
-case "$ARCH" in
-  "aarch64") export SWITCHES="-mlittle-endian" # we don't have -m64, so let's use some dummy switch that is enabled by default
-    ;;
-  "i386") export SWITCHES="-m32"
-    ;;
-  "ppc64") export SWITCHES="-m32 -m64"
-    ;;
-  "ppc64le") export SWITCHES="-m64"
-    ;;
-  "s390x") export SWITCHES="-m31 -m64"
-    ;;
-  "x86_64") export SWITCHES="-m32 -m64"
-    ;;
-esac
 
-# Always try both -m32 and -m64.
-for m in $SWITCHES; do
-  rlPhaseStartTest "Compile and run [$m]"
-    rlRun "$GCC $m hello.c -o hello_c"
-    rlRun "./hello_c"
-
-    rlRun "$GXX $m hello.cpp -o hello_cpp"
-    rlRun "./hello_cpp"
-
-    # Now try a few C++11 features.
-    $GXX -xc++ -std=c++11 - <<< "int main(){}"
-    if test $? -eq 0; then
-      rlRun "$GXX $m -std=c++11 lambda-template.C -o lambda"
-      rlRun "./lambda"
-
-      rlRun "$GXX $m -std=c++11 cpp11.cpp -o cpp11"
-      rlRun "./cpp11"
-    fi
-
-    rlRun "$GFORTRAN $m hello.f90 -o hello_fortran"
-    rlRun "./hello_fortran"
-
-    # TM support is GCC >=4.7 only.
-    $GCC -xc -O2 -std=gnu99 -fgnu-tm - <<< "int main(){}"
-    if test $? -eq 0; then
-	rlRun "$GCC $m -O2 -std=gnu99 -fgnu-tm tm.c -o tm"
-	rlRun "./tm"
-    fi
-
-    # Test OpenMP.
-    rlRun "$GCC $m omphello.c -O2 -std=gnu99 -fopenmp -o omp"
-    rlRun "./omp"
-
-    # Test __thread.
-    rlRun "$GCC $m thr-init-2.c -O2 -std=gnu99 -ftls-model=initial-exec -o thr" 
-    rlRun "./thr"
-
-    # Now test some libquadmath stuff (__float128 support).
-    # libquadmath is mising on RHEL machines, usually.
-    # But with DTS, this should be available.
-    if [ ! -z ${UNDER_DTS} ]; then
-      if [ "`arch`" = 'x86_64' ]; then
-        rlRun "$GCC $m quad.c -O2 -std=gnu99 -lquadmath -o quad -lm"
-        rlRun "./quad"
-      else
-        rlLog "quadmath test skipped (needs x86_64)"
-      fi
-    fi
-
-    # And now something from libgcc, e.g. __builtin___clear_cache.
-    rlRun "$GCC $m clear_cache.c -O2 -std=gnu99 -o cache"
-    rlRun "./cache"
-  rlPhaseEnd
-done; unset m
-
-  rlPhaseStartCleanup
-    rlRun "popd"
-    rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
-  rlPhaseEnd
+    rlPhaseStartCleanup
+        rlRun popd
+        rlRun "rm -r $TmpDir"
+    rlPhaseEnd
 rlJournalPrintText
 rlJournalEnd

                 reply	other threads:[~2026-06-29 12:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178273621076.1.8317156955452409465.rpms-gcc-85fff34818f2@fedoraproject.org \
    --to=acernek@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox