#1 Initial commit for downstream tests using standard test interface
Opened 6 years ago by rasibley. Modified 6 years ago
rpms/ rasibley/gcc gcc-tests  into  rawhide

@@ -0,0 +1,60 @@ 

+ # Copyright (c) 2008, 2012 Red Hat, Inc. All rights reserved.

+ #

+ # This program is free software: you can redistribute it and/or modify

+ # it under the terms of the GNU General Public License as published by

+ # the Free Software Foundation, either version 3 of the License, or

+ # (at your option) any later version.

+ # 

+ # 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, see <http://www.gnu.org/licenses/>.

+ # 

+ # Author: Michal Nowak <mnowak@redhat.com>

+ # 	  Marek Polacek <polacek@redhat.com>

+ 

+ 

+ TOPLEVEL_NAMESPACE=/tools

+ PACKAGE_NAME=gcc

+ RELATIVE_PATH=Regression/OpenMP/445666-OpenMP-segv

+ 

+ export TEST=$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH)

+ export TESTVERSION=1.0

+ 

+ BUILT_FILES=

+ 

+ FILES=$(METADATA) runtest.sh Makefile PURPOSE reproducer.f90

+ 

+ .PHONY: all install download clean

+ 

+ run: $(FILES) build

+ 	./runtest.sh

+ 

+ build: $(BUILT_FILES)

+ 	chmod a+x ./runtest.sh

+ 

+ clean:

+ 	rm -f *~ $(BUILT_FILES)

+ 

+ 

+ include /usr/share/rhts/lib/rhts-make.include

+ 

+ 

+ $(METADATA): Makefile

+ 	@touch $(METADATA)

+ 	@echo "Owner:        Marek Polacek <mpolacek@redhat.com>" > $(METADATA)

+ 	@echo "Name:         $(TEST)" >> $(METADATA)

+ 	@echo "Path:         $(TEST_DIR)"       >> $(METADATA)

+ 	@echo "TestVersion:  $(TESTVERSION)"    >> $(METADATA)

+ 	@echo "Description:  Optimized Fortran code segfaults with multidimensional private common block in thread" >> $(METADATA)

+ 	@echo "Type:         Regression" >> $(METADATA)

+ 	@echo "TestTime:     5m" >> $(METADATA)

+ 	@echo "RunFor:       $(PACKAGE_NAME)" >> $(METADATA)

+ 	@echo "Requires:     gcc-gfortran libgomp" >> $(METADATA)

+ 	@echo "Architectures: x86_64 i386" >> $(METADATA)

+ 	@echo "License:      GPLv3+" >> $(METADATA)

+ 

+ 	rhts-lint $(METADATA)

@@ -0,0 +1,5 @@ 

+ It simplifies down to the enclosed program. It can only be reproduced if:

+ 

+ * The program is compiled Optimized (-O or better)

+ * The program is compiled with OpenMP (-fopenmp)

+ * The array that's in the thread private common block is multidimensional.

@@ -0,0 +1,16 @@ 

+ program foo

+         implicit none

+         common /bobcom/ bob(2)

+ !$omp threadprivate (/bobcom/)

+ 

+         integer i

+         real*8 bob

+ 

+         do i=1,2

+         write(*,*) i

+         bob(i)=0.0d0

+         enddo

+ 

+         end program

+ 

+ 

@@ -0,0 +1,55 @@ 

+ #!/bin/bash

+ # Copyright (c) 2008 Red Hat, Inc. All rights reserved.

+ #

+ # This program is free software: you can redistribute it and/or modify

+ # it under the terms of the GNU General Public License as published by

+ # the Free Software Foundation, either version 3 of the License, or

+ # (at your option) any later version.

+ # 

+ # 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, see <http://www.gnu.org/licenses/>.

+ # 

+ # Author: Michal Nowak <mnowak@redhat.com>

+ #         Marek Polacek <polacek@redhat.com>

+ 

+ # Include rhts environment

+ . /usr/bin/rhts-environment.sh

+ . /usr/lib/beakerlib/beakerlib.sh

+ 

+ PACKAGES=(gcc libgomp gcc-gfortran)

+ 

+ # Choose the compiler.

+ GFORTRAN=${GFORTRAN:-gfortran}

+ 

+ rlJournalStart

+ 	rlPhaseStartSetup

+ 		rlLog "GFORTRAN = $GFORTRAN"

+ 		rlLog "Installed within `rpmquery -f $(which $GFORTRAN)`"

+ 		rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"

+ 		rlRun "cp -v reproducer.f90 $TmpDir"

+ 		rlRun "pushd $TmpDir"

+ 	rlPhaseEnd

+ 

+ 	rlPhaseStartTest "Testing the executable"

+ 		for opt in 0 1 2 3; do

+ 			rlRun "$GFORTRAN -o reproducer_$opt reproducer.f90 -O$opt -fopenmp" 0 "Compile the testcase (-O$opt)"

+ 			rlRun "./reproducer_$opt" 0 "Checking we have a working executable (-O$opt)"

+ 		done

+ 	rlPhaseEnd

+ 

+ 	rlPhaseStartTest "Testing the assembly"

+ 		rlRun "$GFORTRAN -S -c reproducer.f90" 0 "Create assembly"

+ 		rlRun "grep movabsq reproducer.s" 1 "movabsq must *not* be present"

+ 	rlPhaseEnd

+ 

+ 	rlPhaseStartCleanup

+ 		rlRun "popd"

+ 		rlRun "rm -r $TmpDir" 0 "Removing tmp directory"

+ 	rlPhaseEnd

+ rlJournalPrintText

+ rlJournalEnd

@@ -0,0 +1,63 @@ 

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Makefile of g-fails-to-compile-a-program-that-has-a-template

+ #   Description: Try to compile a program that has a template parameter with a boolean expression involving a templated static constant

+ #   Author: Marek Polacek <mpolacek@redhat.com>

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Copyright (c) 2011, 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/Regression/g-fails-to-compile-a-program-that-has-a-template

+ export TESTVERSION=1.0

+ 

+ BUILT_FILES=

+ 

+ FILES=$(METADATA) runtest.sh Makefile PURPOSE f.cc

+ 

+ .PHONY: all install download clean

+ 

+ run: $(FILES) build

+ 	./runtest.sh

+ 

+ build: $(BUILT_FILES)

+ 	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:     Try to compile a program that has a template parameter with a boolean expression involving a templated static constant" >> $(METADATA)

+ 	@echo "Type:            Regression" >> $(METADATA)

+ 	@echo "TestTime:        5m" >> $(METADATA)

+ 	@echo "RunFor:          gcc" >> $(METADATA)

+ 	@echo "Requires:        gcc gcc-c++" >> $(METADATA)

+ 	@echo "Priority:        Normal" >> $(METADATA)

+ 	@echo "License:         GPLv2" >> $(METADATA)

+ 	@echo "Confidential:    no" >> $(METADATA)

+ 	@echo "Destructive:     no" >> $(METADATA)

+ 

+ 	rhts-lint $(METADATA)

@@ -0,0 +1,3 @@ 

+ PURPOSE of /tools/gcc/Regression/g-fails-to-compile-a-program-that-has-a-template

+ Description: Try to compile a program that has a template parameter with a boolean expression involving a templated static constant

+ Author: Marek Polacek <mpolacek@redhat.com>

@@ -0,0 +1,15 @@ 

+ template <bool C> int func (void);

+ 

+ template <class T> struct Foo

+ {

+   static const unsigned int a = sizeof (T);

+ 

+   //enum { b = a };

+ 

+   enum

+   {

+     c = sizeof (func < (a == 0) > ())

+   };

+ };

+ 

+ Foo <int> x;

@@ -0,0 +1,62 @@ 

+ #!/bin/bash

+ # vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   runtest.sh of /tools/gcc/Regression/g-fails-to-compile-a-program-that-has-a-template

+ #   Description: Try to compile a program that has a template parameter with a boolean expression involving a templated static constant

+ #   Author: Marek Polacek <mpolacek@redhat.com>

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Copyright (c) 2011, 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 rhts environment

+ . /usr/bin/rhts-environment.sh

+ . /usr/lib/beakerlib/beakerlib.sh

+ 

+ PACKAGES=(gcc gcc-c++)

+ 

+ # Choose the compiler.

+ GXX=${GXX:-g++}

+ 

+ rlJournalStart

+ 	rlPhaseStartSetup

+ 		for p in "${PACKAGES[@]}"; do

+ 			rlAssertRpm "$p" || yum -y install "$p"

+ 		done; unset p

+ 		rlLog "GXX = $GXX"

+ 		rlLog "Installed within `rpmquery -f $(which $GXX)`"

+ 		rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"

+ 		rlRun "cp -v f.cc $TmpDir"

+ 		rlRun "pushd $TmpDir"

+ 	rlPhaseEnd

+ 

+ 	rlPhaseStartTest

+ 		# Just try to compile the reproducer.

+ 		rlRun "$GXX -c f.cc" 0 "Compiling the reproducer"

+ 		rlAssertExists "f.o"

+ 		rlRun "file f.o | grep ELF" 0 "Basic obj file sanity check"

+ 	rlPhaseEnd

+ 

+ 	rlPhaseStartCleanup

+ 		rlRun "popd"

+ 		rlRun "rm -r $TmpDir" 0 "Removing tmp directory"

+ 	rlPhaseEnd

+ rlJournalPrintText

+ rlJournalEnd

@@ -0,0 +1,59 @@ 

+ # Copyright (c) 2008, 2012 Red Hat, Inc. All rights reserved.

+ #

+ # This program is free software: you can redistribute it and/or modify

+ # it under the terms of the GNU General Public License as published by

+ # the Free Software Foundation, either version 3 of the License, or

+ # (at your option) any later version.

+ # 

+ # 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, see <http://www.gnu.org/licenses/>.

+ # 

+ # Author: Michal Nowak <mnowak@redhat.com>

+ #	  Marek Polacek <polacek@redhat.com>

+ 

+ 

+ TOPLEVEL_NAMESPACE=/tools

+ PACKAGE_NAME=gcc

+ RELATIVE_PATH=Regression/g++/441639-libstdc++-v3-locale-collate-and-time-swapped

+ 

+ export TEST=$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH)

+ export TESTVERSION=1.0

+ 

+ BUILT_FILES=

+ 

+ FILES=$(METADATA) runtest.sh Makefile PURPOSE reproducer.cpp

+ 

+ .PHONY: all install download clean

+ 

+ run: $(FILES) build

+ 	./runtest.sh

+ 

+ build: $(BUILT_FILES)

+ 	chmod a+x ./runtest.sh

+ 

+ clean:

+ 	rm -f *~ $(BUILT_FILES)

+ 

+ 

+ include /usr/share/rhts/lib/rhts-make.include

+ 

+ 

+ $(METADATA): Makefile

+ 	@touch $(METADATA)

+ 	@echo "Owner:        Marek Polacek <mpolacek@redhat.com>" > $(METADATA)

+ 	@echo "Name:         $(TEST)" >> $(METADATA)

+ 	@echo "Path:         $(TEST_DIR)"       >> $(METADATA)

+ 	@echo "TestVersion:  $(TESTVERSION)"    >> $(METADATA)

+ 	@echo "Description:  locale confusion with time-collate categories" >> $(METADATA)

+ 	@echo "Type:         Regression" >> $(METADATA)

+ 	@echo "TestTime:     5m" >> $(METADATA)

+ 	@echo "RunFor:       $(PACKAGE_NAME)" >> $(METADATA)

+ 	@echo "Requires:     $(PACKAGE_NAME)-c++" >> $(METADATA)

+ 	@echo "License:      GPLv3+" >> $(METADATA)

+ 

+ 	rhts-lint $(METADATA)

@@ -0,0 +1,25 @@ 

+ Actual results:

+ 

+ (generated from RHEL5 w/ latest gcc errata)

+ 

+ Time in default locale: Wed Apr  9 04:59:41 2008

+ Old locale name: C

+ New locale name:

+ LC_CTYPE=C;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=C;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C

+ Time in hybrid locale: Wed 09 Apr 2008 04:59:41 AM EDT

+ 

+ Note that only std::locale::collate was set, and NOT std::locale::time . In the

+ resulting locale name, LC_TIME has been changed to en_US.UTF-8 instead of

+ LC_COLLATE.  The current time display lines show that this is not just a name

+ string output bug, but affects locale handling of dates as well.

+ 

+ 

+ Expected results:

+ 

+ (generated from patched system)

+ 

+ Time in default locale: Wed Apr  9 04:55:50 2008

+ Old locale name: C

+ New locale name:

+ LC_CTYPE=C;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=en_US.UTF-8;LC_MONETARY=C;LC_MESSAGES=C;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C

+ Time in hybrid locale: Wed Apr  9 04:55:50 2008

@@ -0,0 +1,43 @@ 

+ #include <iostream>

+ #include <string>

+ #include <ctime>

+ #include <sstream>

+ 

+ using namespace std;

+ 

+ locale SetCppLocale()

+ {

+         locale loc;

+         locale temp(std::locale::classic(), "en_US.UTF-8", std::locale::collate );

+         locale oldLoc = std::locale::global(temp);

+ 

+         return oldLoc;

+ }

+ 

+ string DoDateTimeString()

+ {

+         time_t utcTime;

+         time(&utcTime);

+         struct tm *time = localtime(&utcTime);

+         char buffer[300];

+         strftime(buffer, 300, "%c", time);

+         return string(buffer);

+ }

+ 

+ int main()

+ {

+         string time = DoDateTimeString();

+         cout << "Time in default locale: " << time << endl;

+ 

+         locale oldLoc = SetCppLocale();

+         cout << "Old locale name: " << oldLoc.name() << endl;

+         locale newLoc;

+         cout << "New locale name: " << newLoc.name() << endl;

+ 

+         time = DoDateTimeString();

+         cout << "Time in hybrid locale: " << time << endl;

+ 

+         return 0;

+ }

+ 

+ 

@@ -0,0 +1,56 @@ 

+ #!/bin/bash

+ 

+ # Copyright (c) 2008, 2012 Red Hat, Inc. All rights reserved.

+ #

+ # This program is free software: you can redistribute it and/or modify

+ # it under the terms of the GNU General Public License as published by

+ # the Free Software Foundation, either version 3 of the License, or

+ # (at your option) any later version.

+ #

+ # 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, see <http://www.gnu.org/licenses/>.

+ #

+ # Author: Michal Nowak <mnowak@redhat.com>

+ #	  Marek Polacek <polacek@redhat.com>

+ 

+ # Include rhts environment

+ . /usr/bin/rhts-environment.sh

+ . /usr/lib/beakerlib/beakerlib.sh

+ 

+ PACKAGES=(gcc gcc-c++)

+ 

+ # Choose the compiler.

+ GXX=${GXX:-g++}

+ 

+ rlJournalStart

+ 	rlPhaseStartSetup

+ 		for p in "${PACKAGES[@]}"; do

+ 			rlAssertRpm "$p"

+ 		done; unset p

+ 		rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"

+ 		# We need the reproducer.

+ 		rlRun "cp -v reproducer.cpp $TmpDir"

+ 		rlRun "pushd $TmpDir"

+ 	rlPhaseEnd

+ 

+ 	rlPhaseStartTest "Testing the executable"

+ 		# Compile

+ 		rlRun "$GXX -g reproducer.cpp -o reproducer" 0 "Compiling the test case"

+ 		# Exec-Test

+ 		rlRun "./reproducer" 0 "Checking whether we have an working executable"

+ 		# Test

+ 		rlRun "./reproducer | grep 'LC_TIME=C'" 0 "Do we have 'LC_TIME=C'?"

+ 		rlRun "./reproducer | grep 'LC_COLLATE=en_US.UTF-8'" 0 "Do we have 'LC_COLLATE=en_US.UTF-8'?"

+ 	rlPhaseEnd

+ 

+ 	rlPhaseStartCleanup

+ 		rlRun "popd"

+ 		rlRun "rm -r $TmpDir" 0 "Removing tmp directory"

+ 	rlPhaseEnd

+ rlJournalPrintText

+ rlJournalEnd

@@ -0,0 +1,65 @@ 

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   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" >> $(METADATA)

+ 	@echo "Priority:        Normal" >> $(METADATA)

+ 	@echo "License:         GPLv2" >> $(METADATA)

+ 	@echo "Confidential:    no" >> $(METADATA)

+ 	@echo "Destructive:     no" >> $(METADATA)

+ 

+ 	rhts-lint $(METADATA)

@@ -0,0 +1,3 @@ 

+ PURPOSE of /tools/gcc/Sanity/smoke-test

+ Description: Basic smoke test.

+ Author: Marek Polacek <polacek@redhat.com>

@@ -0,0 +1,7 @@ 

+ int

+ main (void)

+ {

+   char *mem = __builtin_alloca (40);

+   __builtin___clear_cache (mem, mem + 40);

+   return 0;

+ }

@@ -0,0 +1,7 @@ 

+ #include <stdio.h>

+ 

+ int

+ main (void)

+ {

+   puts ("Hello World!");

+ }

@@ -0,0 +1,7 @@ 

+ #include <iostream>

+ 

+ int

+ main (void)

+ {

+  std::cout << "Hello, world!\n";

+ }

@@ -0,0 +1,3 @@ 

+        program hello

+           print *, "Hello World!"

+        end program hello

@@ -0,0 +1,24 @@ 

+ #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;

+ }

@@ -0,0 +1,38 @@ 

+ #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;

+ }

@@ -0,0 +1,122 @@ 

+ #!/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/bin/rhts-environment.sh

+ . /usr/lib/beakerlib/beakerlib.sh

+ 

+ PACKAGES=(gcc gcc-c++ gcc-gfortran glibc-common libgomp libgcc glibc-devel)

+ 

+ # Choose the compiler.

+ GCC=${GCC:-gcc}

+ GXX=${GXX:-g++}

+ GFORTRAN=${GFORTRAN:-gfortran}

+ 

+ PACKAGE=gcc

+ 

+ rlJournalStart

+   rlPhaseStartSetup

+     # don't assert anything under devtoolset

+     if type gcc | grep -q -v devtoolset

+     then

+       for p in "${PACKAGES[@]}"; do

+         rpm -q "$p" || yum install -y "$p"

+         rlAssertRpm "$p"

+       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"

+   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.

+     rpm -q libquadmath

+     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

@@ -0,0 +1,24 @@ 

+ /* { 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;

+ }

@@ -0,0 +1,34 @@ 

+ 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 );

+ }

file added
+25
@@ -0,0 +1,25 @@ 

+ ---

+ # Tests for classic and container

+ - hosts: localhost

+   roles:

+   - role: standard-test-beakerlib

+     tags:

+     - classic

+     - container

+     tests:

+     - libstdc++-v3-locale-collate-and-time-swapped

+     - g-fails-to-compile-a-program-that-has-a-template

+     - smoke-test

+     - OpenMP-segv

+     required_packages:

+     - gcc-c++

+     - gcc-gfortran

+     - libgomp

+     - gcc

+     - glibc-common

+     - glibc-devel

+     - libquadmath

+     - libquadmath-devel

+     - libgomp

+     - libgcc

+     - file

Adds tests according to the CI wiki [0] specifically the standard test interface in the spec [1].

The playbook includes Tier1 level test cases that have been tested in the following contexts and is passing reliably: Docker, and Classic.
Test logs are stored in the Artifacts directory. Currently tests are not suitable for Atomic but may be updated later to support it.

The following steps are used to execute the tests using the standard test interface:

  • Atomic
    sudo ANSIBLE_INVENTORY=$(test -e inventory && echo inventory || echo /usr/share/ansible/inventory) TEST_SUBJECTS=../atomic.qcow2 TEST_ARTIFACTS=$PWD/artifacts ansible-playbook --tags atomic tests.yml

  • Docker
    sudo ANSIBLE_INVENTORY=$(test -e inventory && echo inventory || echo /usr/share/ansible/inventory) TEST_DEBUG=1 TEST_SUBJECTS=docker:docker.io/library/fedora:26 TEST_ARTIFACTS=$PWD/artifacts ansible-playbook --tags container tests.yml

  • Classic
    sudo ANSIBLE_INVENTORY=$(test -e inventory && echo inventory || echo /usr/share/ansible/inventory) TEST_SUBJECTS="" TEST_ARTIFACTS=$PWD/artifacts ansible-playbook --tags classic tests.yml

Test Logs: (If you would like a pointer to the complete log, I can include that as well)

  • Docker
    <snip>
    13:46:35 TASK [standard-test-beakerlib : Execute beakerlib tests]
    13:46:38 changed: [528d874f8c54392005798c2361ca21716d47a593323b1f5191a00e0786812d23] => (item=libstdc++-v3-locale-collate-and-time-swapped)
    13:46:40 changed: [528d874f8c54392005798c2361ca21716d47a593323b1f5191a00e0786812d23] => (item=g-fails-to-compile-a-program-that-has-a-template)
    13:46:47 changed: [528d874f8c54392005798c2361ca21716d47a593323b1f5191a00e0786812d23] => (item=smoke-test)
    13:46:49 changed: [528d874f8c54392005798c2361ca21716d47a593323b1f5191a00e0786812d23] => (item=OpenMP-segv)
    13:46:49
    13:46:49 TASK [standard-test-beakerlib : Make the master test summary log artifact]
    13:46:50 changed: [528d874f8c54392005798c2361ca21716d47a593323b1f5191a00e0786812d23] => (item=libstdc++-v3-locale-collate-and-time-swapped)
    13:46:51 changed: [528d874f8c54392005798c2361ca21716d47a593323b1f5191a00e0786812d23] => (item=g-fails-to-compile-a-program-that-has-a-template)
    13:46:52 changed: [528d874f8c54392005798c2361ca21716d47a593323b1f5191a00e0786812d23] => (item=smoke-test)
    13:46:52 changed: [528d874f8c54392005798c2361ca21716d47a593323b1f5191a00e0786812d23] => (item=OpenMP-segv)
    13:46:52
    13:46:52 TASK [standard-test-beakerlib : Pull out the logs]
    13:46:53 changed: [528d874f8c54392005798c2361ca21716d47a593323b1f5191a00e0786812d23]
    13:46:53
    13:46:53 TASK [standard-test-beakerlib : Check the results]
    13:46:53 changed: [528d874f8c54392005798c2361ca21716d47a593323b1f5191a00e0786812d23]
    13:46:53
    13:46:53 PLAY RECAP
    13:46:53 528d874f8c54392005798c2361ca21716d47a593323b1f5191a00e0786812d23 : ok=15 changed=11 unreachable=0 failed=0
    13:46:53
    13:46:53 ###################################
    13:46:53 Test results:
    13:46:53 ###################################
    13:46:53 PASS libstdc++-v3-locale-collate-and-time-swapped
    13:46:53 PASS g-fails-to-compile-a-program-that-has-a-template
    13:46:53 PASS smoke-test
    13:46:53 PASS OpenMP-segv

  • Classic
    <snip>
    13:42:31 ==> default: TASK [standard-test-beakerlib : Execute beakerlib tests]
    13:42:35 ==> default: changed: [localhost] => (item=libstdc++-v3-locale-collate-and-time-swapped)
    13:42:37 ==> default: changed: [localhost] => (item=g-fails-to-compile-a-program-that-has-a-template)
    13:42:42 ==> default: changed: [localhost] => (item=smoke-test)
    13:42:45 ==> default: changed: [localhost] => (item=OpenMP-segv)
    13:42:45 ==> default:
    13:42:45 ==> default: TASK [standard-test-beakerlib : Make the master test summary log artifact]
    13:42:45 ==> default: changed: [localhost] => (item=libstdc++-v3-locale-collate-and-time-swapped)
    13:42:45 ==> default: changed: [localhost] => (item=g-fails-to-compile-a-program-that-has-a-template)
    13:42:45 ==> default: changed: [localhost] => (item=smoke-test)
    13:42:45 ==> default: changed: [localhost] => (item=OpenMP-segv)
    13:42:45 ==> default:
    13:42:45 ==> default: TASK [standard-test-beakerlib : Pull out the logs]
    13:42:46 ==> default: changed: [localhost]
    13:42:46 ==> default:
    13:42:46 ==> default: TASK [standard-test-beakerlib : Check the results]
    13:42:46 ==> default: changed: [localhost]
    13:42:46 ==> default:
    13:42:46 ==> default: PLAY RECAP
    13:42:46 ==> default: localhost : ok=15 changed=12 unreachable=0 failed=0
    13:42:46 ==> default: ++ '[' 0 -ne 0 ']'
    13:42:46 ==> default: ++ cat /root/gcc/artifacts/test.log
    13:42:46 ==> default: PASS libstdc++-v3-locale-collate-and-time-swapped
    13:42:46 ==> default: PASS g-fails-to-compile-a-program-that-has-a-template
    13:42:46 ==> default: PASS smoke-test
    13:42:46 ==> default: PASS OpenMP-segv
    13:42:46 ==> default: ++ grep -ve '^PASS' /root/gcc/artifacts/test.log
    13:42:46 ==> default: PASS: all tests passed.
    13:42:46 ==> default: ++ '[' 1 -eq 1 ']'
    13:42:46 ==> default: ++ echo 'PASS: all tests passed.'

Tests will be enabled in CI, yet gating is currently disabled, so nothing will change. However eventually gating will be enabled. Tests will run on each dist-git commit, they are not triggered on koji builds and if you are using FMN, it should notify you of failures normally.

The RH QE maintainer contact in case you have questions: mpetlan@redhat.com
The idea is that these tests become yours just as you're maintaining the package, there will of course be people around if you have questions or troubles.

[0] https://fedoraproject.org/wiki/CI
[1] https://fedoraproject.org/wiki/Changes/InvokingTests

Hello, just following up to see if there is any additional information I can provide to help move this along ? Thanks!

(I'm not the gcc maintainer)

Why these four test files? They seem somewhat arbitrary. GCC upstream has thousands and thousands of tests, which are run several times a day (see https://gcc.gnu.org/ml/gcc-testresults/current/ for the latest results).

While CI is certainly a Good Thing, the coverage that will be possible by adding a few tests in Fedora will always be a fraction of the more thorough testing done upstream (by many of the same people who maintain GCC in Fedora). Are these particular tests significant?

Hello, I am responding on behalf of mpetlan@redhat.com who had provided these tests:

"(I am neither gcc maintainer nor fedora guy)
I was asked to pick some gcc testcases from our test repository for this purpose. They are rather a proof of concept than anything trying to be a "good test coverage". This is a part of the process of "upstreaming Red Hat tests" which means porting some RHEL tests to Fedora. I know that for gcc it does not make much sense as it is now (99.9 % of all its tests are in the testsuite), but for other packages this process brings some value in extending the testing set at the Fedora level.
The main goal I see in the area of gcc and CI is some testsuite log review automation. I have some concept I use within RHEL testing but it still needs to be improved a bit. Possibly, it will land here one day too."

Makes sense, thanks for the explanation.

Hi we're still waiting on review/merge for the gcc tests ? Are you still still waiting on additional information, what other details can we provide to get this PR merged/reviewed ? Thank you.