Extend the downstream test coverage
- The only test moved to CentOS https://gitlab.com/redhat/centos-stream/tests/gcc/-/tree/main/tests/Sanity/smoke-test - The original test plan removed (ci.fmf) - New test plan created (tier0.fmf). It includes all the tests in CentOS labeled as tier 1.
This commit is contained in:
parent
788a7e892e
commit
9866f681df
@ -1,5 +0,0 @@
|
|||||||
summary: CI Gating Plan
|
|
||||||
discover:
|
|
||||||
how: fmf
|
|
||||||
execute:
|
|
||||||
how: tmt
|
|
36
plans/tier0.fmf
Normal file
36
plans/tier0.fmf
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# Tier 0 test plan. It's actually Tier 1
|
||||||
|
# - limited to its public part
|
||||||
|
# - executed on the architecture at hand
|
||||||
|
# When run by osci.tier0 on CentOS Stream or RHEL, it receives the following
|
||||||
|
# context:
|
||||||
|
# arch=x86_64 (the architecture at hand, currently OSCI uses just x86_64)
|
||||||
|
# distro=rhel<M>.<m> (even for CentOS Stream builds)
|
||||||
|
# trigger=build
|
||||||
|
|
||||||
|
summary: Tier 0 test plan
|
||||||
|
discover:
|
||||||
|
- name: collect_info
|
||||||
|
how: shell
|
||||||
|
tests:
|
||||||
|
- name: /info/rpms
|
||||||
|
test: rpm -qa --last
|
||||||
|
- name: public_tests
|
||||||
|
how: fmf
|
||||||
|
url: https://gitlab.com/redhat/centos-stream/tests/gcc.git
|
||||||
|
filter: 'tag: CI-Tier-1'
|
||||||
|
provision+:
|
||||||
|
hardware:
|
||||||
|
disk:
|
||||||
|
- size: ">= 60 GiB"
|
||||||
|
memory: ">= 8 GiB"
|
||||||
|
execute:
|
||||||
|
how: tmt
|
||||||
|
adjust+:
|
||||||
|
- when: distro > rhel-7
|
||||||
|
prepare+:
|
||||||
|
- how: shell
|
||||||
|
script:
|
||||||
|
- dnf config-manager --set-enabled '*CRB*' || true
|
||||||
|
- dnf config-manager --set-enabled crb || true
|
||||||
|
- dnf config-manager --set-enabled rhel-buildroot || true
|
||||||
|
- dnf config-manager --set-enabled epel || true
|
@ -1,65 +0,0 @@
|
|||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
#
|
|
||||||
# Makefile of /tools/gcc/Sanity/smoke-test
|
|
||||||
# Description: Basic smoke test.
|
|
||||||
# Author: Marek Polacek <polacek@redhat.com>
|
|
||||||
#
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
#
|
|
||||||
# Copyright (c) 2012 Red Hat, Inc. All rights reserved.
|
|
||||||
#
|
|
||||||
# This copyrighted material is made available to anyone wishing
|
|
||||||
# to use, modify, copy, or redistribute it subject to the terms
|
|
||||||
# and conditions of the GNU General Public License version 2.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be
|
|
||||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
|
||||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
||||||
# PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public
|
|
||||||
# License along with this program; if not, write to the Free
|
|
||||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
# Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
export TEST=/tools/gcc/Sanity/smoke-test
|
|
||||||
export TESTVERSION=1.0
|
|
||||||
|
|
||||||
BUILT_FILES=
|
|
||||||
|
|
||||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE hello.c hello.f90 hello.cpp tm.c quad.c omphello.c thr-init-2.c clear_cache.c
|
|
||||||
|
|
||||||
.PHONY: all install download clean
|
|
||||||
|
|
||||||
run: $(FILES) build
|
|
||||||
./runtest.sh
|
|
||||||
|
|
||||||
build: $(BUILT_FILES)
|
|
||||||
test -x runtest.sh || chmod a+x runtest.sh
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *~ $(BUILT_FILES)
|
|
||||||
|
|
||||||
|
|
||||||
include /usr/share/rhts/lib/rhts-make.include
|
|
||||||
|
|
||||||
$(METADATA): Makefile
|
|
||||||
@echo "Owner: Marek Polacek <mpolacek@redhat.com>" > $(METADATA)
|
|
||||||
@echo "Name: $(TEST)" >> $(METADATA)
|
|
||||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
|
||||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
|
||||||
@echo "Description: Basic smoke test." >> $(METADATA)
|
|
||||||
@echo "Type: Sanity" >> $(METADATA)
|
|
||||||
@echo "TestTime: 10m" >> $(METADATA)
|
|
||||||
@echo "RunFor: gcc" >> $(METADATA)
|
|
||||||
@echo "RunFor: devtoolset-1.0-gcc" >> $(METADATA)
|
|
||||||
@echo "Requires: gcc gcc-c++ gcc-gfortran glibc-common glibc-devel" >> $(METADATA)
|
|
||||||
@echo "Requires: libquadmath libquadmath-devel libgomp libgcc libstdc++-devel" >> $(METADATA)
|
|
||||||
@echo "Priority: Normal" >> $(METADATA)
|
|
||||||
@echo "License: GPLv2" >> $(METADATA)
|
|
||||||
@echo "Confidential: no" >> $(METADATA)
|
|
||||||
@echo "Destructive: no" >> $(METADATA)
|
|
||||||
|
|
||||||
rhts-lint $(METADATA)
|
|
@ -1,3 +0,0 @@
|
|||||||
PURPOSE of /tools/gcc/Sanity/smoke-test
|
|
||||||
Description: Basic smoke test.
|
|
||||||
Author: Marek Polacek <polacek@redhat.com>
|
|
@ -1,7 +0,0 @@
|
|||||||
int
|
|
||||||
main (void)
|
|
||||||
{
|
|
||||||
char *mem = __builtin_alloca (40);
|
|
||||||
__builtin___clear_cache (mem, mem + 40);
|
|
||||||
return 0;
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
int
|
|
||||||
main (void)
|
|
||||||
{
|
|
||||||
puts ("Hello World!");
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
#include <iostream>
|
|
||||||
|
|
||||||
int
|
|
||||||
main (void)
|
|
||||||
{
|
|
||||||
std::cout << "Hello, world!\n";
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
program hello
|
|
||||||
print *, "Hello World!"
|
|
||||||
end program hello
|
|
@ -1,22 +0,0 @@
|
|||||||
summary: Basic smoke test.
|
|
||||||
description: ''
|
|
||||||
contact:
|
|
||||||
- Marek Polacek <mpolacek@redhat.com>
|
|
||||||
component:
|
|
||||||
- gcc
|
|
||||||
test: ./runtest.sh
|
|
||||||
framework: beakerlib
|
|
||||||
recommend:
|
|
||||||
- gcc
|
|
||||||
- gcc-c++
|
|
||||||
- gcc-gfortran
|
|
||||||
- glibc-common
|
|
||||||
- glibc-devel
|
|
||||||
- libquadmath
|
|
||||||
- libquadmath-devel
|
|
||||||
- libgomp
|
|
||||||
- libgcc
|
|
||||||
- libstdc++-devel
|
|
||||||
duration: 10m
|
|
||||||
extra-summary: /tools/gcc/Sanity/smoke-test
|
|
||||||
extra-task: /tools/gcc/Sanity/smoke-test
|
|
@ -1,24 +0,0 @@
|
|||||||
#include <omp.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
int
|
|
||||||
main (void)
|
|
||||||
{
|
|
||||||
int th_id;
|
|
||||||
int nthreads;
|
|
||||||
|
|
||||||
#pragma omp parallel private(th_id)
|
|
||||||
{
|
|
||||||
th_id = omp_get_thread_num ();
|
|
||||||
printf ("Hello World from thread %d\n", th_id);
|
|
||||||
|
|
||||||
#pragma omp barrier
|
|
||||||
if (th_id == 0)
|
|
||||||
{
|
|
||||||
nthreads = omp_get_num_threads ();
|
|
||||||
printf ("There are %d threads\n", nthreads);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
#include <quadmath.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
int
|
|
||||||
main (void)
|
|
||||||
{
|
|
||||||
__float128 r = strtoflt128 ("1.23456789", NULL);
|
|
||||||
|
|
||||||
int prec = 20;
|
|
||||||
int width = 46;
|
|
||||||
char buf[128];
|
|
||||||
|
|
||||||
r = 2.0q;
|
|
||||||
r = sqrtq (r);
|
|
||||||
int n = quadmath_snprintf (buf, sizeof buf, "%+-#*.20Qe", width, r);
|
|
||||||
if ((size_t) n < sizeof buf)
|
|
||||||
/* Prints: +1.41421356237309504880e+00 */
|
|
||||||
printf ("%s\n", buf);
|
|
||||||
quadmath_snprintf (buf, sizeof buf, "%Qa", r);
|
|
||||||
if ((size_t) n < sizeof buf)
|
|
||||||
/* Prints: 0x1.6a09e667f3bcc908b2fb1366ea96p+0 */
|
|
||||||
printf ("%s\n", buf);
|
|
||||||
n = quadmath_snprintf (NULL, 0, "%+-#46.*Qe", prec, r);
|
|
||||||
if (n > -1)
|
|
||||||
{
|
|
||||||
char *str = malloc (n + 1);
|
|
||||||
if (str)
|
|
||||||
{
|
|
||||||
quadmath_snprintf (str, n + 1, "%+-#46.*Qe", prec, r);
|
|
||||||
/* Prints: +1.41421356237309504880e+00 */
|
|
||||||
printf ("%s\n", str);
|
|
||||||
}
|
|
||||||
free (str);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
@ -1,125 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
#
|
|
||||||
# runtest.sh of /tools/gcc/Sanity/smoke-test
|
|
||||||
# Description: Basic smoke test.
|
|
||||||
# Author: Marek Polacek <polacek@redhat.com>
|
|
||||||
#
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
#
|
|
||||||
# Copyright (c) 2012 Red Hat, Inc. All rights reserved.
|
|
||||||
#
|
|
||||||
# This copyrighted material is made available to anyone wishing
|
|
||||||
# to use, modify, copy, or redistribute it subject to the terms
|
|
||||||
# and conditions of the GNU General Public License version 2.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be
|
|
||||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
|
||||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
||||||
# PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public
|
|
||||||
# License along with this program; if not, write to the Free
|
|
||||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
# Boston, MA 02110-1301, USA.
|
|
||||||
#
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
# Include Beaker environment
|
|
||||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
|
||||||
|
|
||||||
PACKAGES=(gcc gcc-c++ gcc-gfortran glibc-common libgomp libgcc glibc-devel libstdc++ libstdc++-devel)
|
|
||||||
|
|
||||||
# Choose the compiler.
|
|
||||||
GCC=${GCC:-gcc}
|
|
||||||
GXX=${GXX:-g++}
|
|
||||||
GFORTRAN=${GFORTRAN:-gfortran}
|
|
||||||
|
|
||||||
PACKAGE=gcc
|
|
||||||
|
|
||||||
rlJournalStart
|
|
||||||
rlPhaseStartSetup
|
|
||||||
export PRI_ARCH=`rlGetPrimaryArch`
|
|
||||||
export SEC_ARCH=`rlGetSecondaryArch`
|
|
||||||
# don't assert anything under devtoolset
|
|
||||||
if type gcc | grep -q -v devtoolset
|
|
||||||
then
|
|
||||||
for p in "${PACKAGES[@]}"; do
|
|
||||||
rpm -q "$p.$PRI_ARCH" || yum install -y "$p.$PRI_ARCH"
|
|
||||||
rlAssertRpm "$p.$PRI_ARCH"
|
|
||||||
done; unset p
|
|
||||||
fi
|
|
||||||
rlLog "GCC = $GCC"
|
|
||||||
rlLog "Installed within `rpmquery -f $(which $GCC)`"
|
|
||||||
rlLog "GXX = $GXX"
|
|
||||||
rlLog "Installed within `rpmquery -f $(which $GXX)`"
|
|
||||||
rlLog "GFORTRAN = $GFORTRAN"
|
|
||||||
rlLog "Installed within `rpmquery -f $(which $GFORTRAN)`"
|
|
||||||
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 $TmpDir"
|
|
||||||
rlRun "pushd $TmpDir"
|
|
||||||
rlRun "rpmquery -l libstdc++-devel.$PRI_ARCH"
|
|
||||||
test -n "$SEC_ARCH" && rpmquery "libstdc++-devel.$SEC_ARCH" && rlRun "rpmquery -l libstdc++-devel.$SEC_ARCH"
|
|
||||||
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
|
|
||||||
done
|
|
||||||
rlPhaseEnd
|
|
||||||
|
|
||||||
rlPhaseStartTest "Compile"
|
|
||||||
rlRun "$GCC hello.c -o hello_c"
|
|
||||||
rlRun "$GXX hello.cpp -o hello_cpp"
|
|
||||||
rlRun "$GFORTRAN hello.f90 -o 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 -O2 -std=gnu99 -fgnu-tm tm.c -o tm"
|
|
||||||
rlRun "./tm"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Test OpenMP.
|
|
||||||
rlRun "$GCC omphello.c -O2 -std=gnu99 -fopenmp -o omp"
|
|
||||||
rlRun "./omp"
|
|
||||||
|
|
||||||
# Test __thread.
|
|
||||||
rlRun "$GCC 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.
|
|
||||||
test "`rpmquery --qf '%{version}-%{release}' libquadmath`" = "`rpmquery --qf '%{version}-%{release}' $GCC`"
|
|
||||||
if test $? -eq 0 -a "$GCC" = "gcc"; then
|
|
||||||
rlRun "$GCC quad.c -O2 -std=gnu99 -lquadmath -lm -o quad"
|
|
||||||
rlRun "./quad"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# And now something from libgcc, e.g. __builtin___clear_cache.
|
|
||||||
# But not on RHEL5.
|
|
||||||
if ! rlIsRHEL 5; then
|
|
||||||
rlRun "$GCC clear_cache.c -O2 -std=gnu99 -o cache"
|
|
||||||
rlRun "./cache"
|
|
||||||
fi
|
|
||||||
rlPhaseEnd
|
|
||||||
|
|
||||||
rlPhaseStartTest "Check dependant libraries"
|
|
||||||
rlRun "ldd hello_{c,cpp,fortran} &> ldd.out"
|
|
||||||
# Nothing should be linked against anything in /opt.
|
|
||||||
rlAssertNotGrep "/opt" ldd.out
|
|
||||||
rlPhaseEnd
|
|
||||||
|
|
||||||
rlPhaseStartCleanup
|
|
||||||
rlRun "popd"
|
|
||||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
|
||||||
rlPhaseEnd
|
|
||||||
rlJournalPrintText
|
|
||||||
rlJournalEnd
|
|
@ -1,24 +0,0 @@
|
|||||||
/* { dg-do run } */
|
|
||||||
/* { dg-require-effective-target tls_runtime } */
|
|
||||||
/* { dg-add-options tls } */
|
|
||||||
|
|
||||||
extern void abort() ;
|
|
||||||
|
|
||||||
static __thread int fstat ;
|
|
||||||
static __thread int fstat = 1;
|
|
||||||
|
|
||||||
int test_code(int b)
|
|
||||||
{
|
|
||||||
fstat += b ;
|
|
||||||
return fstat;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main (int ac, char *av[])
|
|
||||||
{
|
|
||||||
int a = test_code(1);
|
|
||||||
|
|
||||||
if ((a != 2) || (fstat != 2))
|
|
||||||
abort () ;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
extern void *malloc (__SIZE_TYPE__) __attribute__((malloc,transaction_safe));
|
|
||||||
|
|
||||||
static int __attribute__((transaction_safe))
|
|
||||||
something (void)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct large { int foo[500]; };
|
|
||||||
|
|
||||||
int
|
|
||||||
main (void)
|
|
||||||
{
|
|
||||||
int *p;
|
|
||||||
struct large *lp;
|
|
||||||
|
|
||||||
__transaction_atomic {
|
|
||||||
p = malloc (sizeof (*p) * 100);
|
|
||||||
lp = malloc (sizeof (*lp) * 100);
|
|
||||||
|
|
||||||
/* No instrumentation necessary; P and LP are transaction local. */
|
|
||||||
p[5] = 123;
|
|
||||||
lp->foo[66] = 123;
|
|
||||||
|
|
||||||
if (something ())
|
|
||||||
__transaction_cancel;
|
|
||||||
}
|
|
||||||
|
|
||||||
__transaction_relaxed {
|
|
||||||
++p[5];
|
|
||||||
}
|
|
||||||
|
|
||||||
return ( (p[5] == 124) ? 0 : 1 );
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user