Merged update from upstream sources

This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/gcc.git#ac8f498836cb54282caf6ee9c6bb0c179029c18c
This commit is contained in:
DistroBaker 2021-01-12 08:17:11 +00:00
parent ba627413ca
commit 8230ff782d
23 changed files with 427 additions and 169 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

1
.gitignore vendored
View File

@ -26,3 +26,4 @@
/gcc-11.0.0-20201216.tar.xz /gcc-11.0.0-20201216.tar.xz
/gcc-11.0.0-20201217.tar.xz /gcc-11.0.0-20201217.tar.xz
/gcc-11.0.0-20201223.tar.xz /gcc-11.0.0-20201223.tar.xz
/gcc-11.0.0-20210109.tar.xz

14
gating.yaml Normal file
View File

@ -0,0 +1,14 @@
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1-gating.functional}
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1-gating-p9.functional}

View File

@ -1,5 +1,5 @@
%global DATE 20201223 %global DATE 20210109
%global gitrev 9265a9d6eb38913206ddc37009fd548c2e4f5de0 %global gitrev 9971024e74d1681c78e9b1f0b7ea1e8a6cda7304
%global gcc_version 11.0.0 %global gcc_version 11.0.0
%global gcc_major 11 %global gcc_major 11
# Note, gcc_release must be integer, if you want to add suffixes to # Note, gcc_release must be integer, if you want to add suffixes to
@ -119,7 +119,7 @@
Summary: Various compilers (C, C++, Objective-C, ...) Summary: Various compilers (C, C++, Objective-C, ...)
Name: gcc Name: gcc
Version: %{gcc_version} Version: %{gcc_version}
Release: %{gcc_release}.11%{?dist} Release: %{gcc_release}.12%{?dist}
# libgcc, libgfortran, libgomp, libstdc++ and crtstuff have # libgcc, libgfortran, libgomp, libstdc++ and crtstuff have
# GCC Runtime Exception. # GCC Runtime Exception.
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
@ -272,8 +272,7 @@ Patch8: gcc11-foffload-default.patch
Patch9: gcc11-Wno-format-security.patch Patch9: gcc11-Wno-format-security.patch
Patch10: gcc11-rh1574936.patch Patch10: gcc11-rh1574936.patch
Patch11: gcc11-d-shared-libphobos.patch Patch11: gcc11-d-shared-libphobos.patch
Patch12: gcc11-pr98282.patch Patch12: gcc11-pr98338-workaround.patch
Patch13: gcc11-pr98338-workaround.patch
# On ARM EABI systems, we do want -gnueabi to be part of the # On ARM EABI systems, we do want -gnueabi to be part of the
# target triple. # target triple.
@ -295,7 +294,7 @@ Patch13: gcc11-pr98338-workaround.patch
%if %{build_go} %if %{build_go}
# Avoid stripping these libraries and binaries. # Avoid stripping these libraries and binaries.
%global __os_install_post \ %global __os_install_post \
chmod 644 %{buildroot}%{_prefix}/%{_lib}/libgo.so.18.* \ chmod 644 %{buildroot}%{_prefix}/%{_lib}/libgo.so.19.* \
chmod 644 %{buildroot}%{_prefix}/bin/go.gcc \ chmod 644 %{buildroot}%{_prefix}/bin/go.gcc \
chmod 644 %{buildroot}%{_prefix}/bin/gofmt.gcc \ chmod 644 %{buildroot}%{_prefix}/bin/gofmt.gcc \
chmod 644 %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/cgo \ chmod 644 %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/cgo \
@ -303,7 +302,7 @@ chmod 644 %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}
chmod 644 %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/test2json \ chmod 644 %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/test2json \
chmod 644 %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/vet \ chmod 644 %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/vet \
%__os_install_post \ %__os_install_post \
chmod 755 %{buildroot}%{_prefix}/%{_lib}/libgo.so.18.* \ chmod 755 %{buildroot}%{_prefix}/%{_lib}/libgo.so.19.* \
chmod 755 %{buildroot}%{_prefix}/bin/go.gcc \ chmod 755 %{buildroot}%{_prefix}/bin/go.gcc \
chmod 755 %{buildroot}%{_prefix}/bin/gofmt.gcc \ chmod 755 %{buildroot}%{_prefix}/bin/gofmt.gcc \
chmod 755 %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/cgo \ chmod 755 %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/cgo \
@ -785,8 +784,7 @@ to NVidia PTX capable devices if available.
%patch10 -p0 -b .rh1574936~ %patch10 -p0 -b .rh1574936~
%endif %endif
%patch11 -p0 -b .d-shared-libphobos~ %patch11 -p0 -b .d-shared-libphobos~
%patch12 -p0 -b .pr98282~ %patch12 -p0 -b .pr98338-workaround~
%patch13 -p0 -b .pr98338-workaround~
echo 'Red Hat %{version}-%{gcc_release}' > gcc/DEV-PHASE echo 'Red Hat %{version}-%{gcc_release}' > gcc/DEV-PHASE
@ -1390,7 +1388,7 @@ ln -sf ../../../libstdc++.so.6.*[0-9] libstdc++.so
ln -sf ../../../libgfortran.so.5.* libgfortran.so ln -sf ../../../libgfortran.so.5.* libgfortran.so
ln -sf ../../../libgomp.so.1.* libgomp.so ln -sf ../../../libgomp.so.1.* libgomp.so
%if %{build_go} %if %{build_go}
ln -sf ../../../libgo.so.18.* libgo.so ln -sf ../../../libgo.so.19.* libgo.so
%endif %endif
%if %{build_libquadmath} %if %{build_libquadmath}
ln -sf ../../../libquadmath.so.0.* libquadmath.so ln -sf ../../../libquadmath.so.0.* libquadmath.so
@ -1420,7 +1418,7 @@ ln -sf ../../../../%{_lib}/libstdc++.so.6.*[0-9] libstdc++.so
ln -sf ../../../../%{_lib}/libgfortran.so.5.* libgfortran.so ln -sf ../../../../%{_lib}/libgfortran.so.5.* libgfortran.so
ln -sf ../../../../%{_lib}/libgomp.so.1.* libgomp.so ln -sf ../../../../%{_lib}/libgomp.so.1.* libgomp.so
%if %{build_go} %if %{build_go}
ln -sf ../../../../%{_lib}/libgo.so.18.* libgo.so ln -sf ../../../../%{_lib}/libgo.so.19.* libgo.so
%endif %endif
%if %{build_libquadmath} %if %{build_libquadmath}
ln -sf ../../../../%{_lib}/libquadmath.so.0.* libquadmath.so ln -sf ../../../../%{_lib}/libquadmath.so.0.* libquadmath.so
@ -1540,8 +1538,8 @@ ln -sf ../`echo ../../../../lib/libgfortran.so.5.* | sed s~/lib/~/lib64/~` 64/li
ln -sf ../`echo ../../../../lib/libgomp.so.1.* | sed s~/lib/~/lib64/~` 64/libgomp.so ln -sf ../`echo ../../../../lib/libgomp.so.1.* | sed s~/lib/~/lib64/~` 64/libgomp.so
%if %{build_go} %if %{build_go}
rm -f libgo.so rm -f libgo.so
echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib/libgo.so.18.* | sed 's,^.*libg,libg,'`' )' > libgo.so echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib/libgo.so.19.* | sed 's,^.*libg,libg,'`' )' > libgo.so
echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib/libgo.so.18.* | sed 's,^.*libg,libg,'`' )' > 64/libgo.so echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib/libgo.so.19.* | sed 's,^.*libg,libg,'`' )' > 64/libgo.so
%endif %endif
%if %{build_libquadmath} %if %{build_libquadmath}
rm -f libquadmath.so rm -f libquadmath.so
@ -1639,8 +1637,8 @@ ln -sf ../`echo ../../../../lib64/libgfortran.so.5.* | sed s~/../lib64/~/~` 32/l
ln -sf ../`echo ../../../../lib64/libgomp.so.1.* | sed s~/../lib64/~/~` 32/libgomp.so ln -sf ../`echo ../../../../lib64/libgomp.so.1.* | sed s~/../lib64/~/~` 32/libgomp.so
%if %{build_go} %if %{build_go}
rm -f libgo.so rm -f libgo.so
echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib64/libgo.so.18.* | sed 's,^.*libg,libg,'`' )' > libgo.so echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib64/libgo.so.19.* | sed 's,^.*libg,libg,'`' )' > libgo.so
echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib64/libgo.so.18.* | sed 's,^.*libg,libg,'`' )' > 32/libgo.so echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib64/libgo.so.19.* | sed 's,^.*libg,libg,'`' )' > 32/libgo.so
%endif %endif
%if %{build_libquadmath} %if %{build_libquadmath}
rm -f libquadmath.so rm -f libquadmath.so
@ -1827,7 +1825,7 @@ chmod 755 %{buildroot}%{_prefix}/%{_lib}/liblsan.so.0.*
%endif %endif
%if %{build_go} %if %{build_go}
# Avoid stripping these libraries and binaries. # Avoid stripping these libraries and binaries.
chmod 644 %{buildroot}%{_prefix}/%{_lib}/libgo.so.18.* chmod 644 %{buildroot}%{_prefix}/%{_lib}/libgo.so.19.*
chmod 644 %{buildroot}%{_prefix}/bin/go.gcc chmod 644 %{buildroot}%{_prefix}/bin/go.gcc
chmod 644 %{buildroot}%{_prefix}/bin/gofmt.gcc chmod 644 %{buildroot}%{_prefix}/bin/gofmt.gcc
chmod 644 %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/cgo chmod 644 %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/cgo
@ -2963,7 +2961,7 @@ end
%doc rpm.doc/go/* %doc rpm.doc/go/*
%files -n libgo %files -n libgo
%attr(755,root,root) %{_prefix}/%{_lib}/libgo.so.18* %attr(755,root,root) %{_prefix}/%{_lib}/libgo.so.19*
%doc rpm.doc/libgo/* %doc rpm.doc/libgo/*
%files -n libgo-devel %files -n libgo-devel
@ -3071,6 +3069,36 @@ end
%endif %endif
%changelog %changelog
* Sat Jan 9 2021 Jakub Jelinek <jakub@redhat.com> 11.0.0-0.12
- update from trunk
- PRs analyzer/97072, analyzer/97074, analyzer/98073, analyzer/98223,
analyzer/98293, analyzer/98564, analyzer/98580, bootstrap/98324,
bootstrap/98506, c++/82099, c++/95768, c++/96045, c++/96504,
c++/97597, c++/98206, c++/98305, c++/98316, c++/98329, c++/98332,
c++/98353, c++/98413, c++/98441, c++/98469, c++/98515, c++/98551,
c/98029, d/98427, fortran/83118, fortran/93701, fortran/93794,
fortran/93833, fortran/97612, fortran/97694, fortran/97723,
fortran/98022, fortran/98458, libstdc++/98384, middle-end/98160,
middle-end/98578, other/98437, rtl-optimization/97144,
rtl-optimization/97978, rtl-optimization/98214,
rtl-optimization/98334, rtl-optimization/98403, target/89057,
target/96793, target/97269, target/98461, target/98482, target/98495,
target/98521, target/98522, target/98567, target/98585,
testsuite/98489, testsuite/98566, tree-optimization/56719,
tree-optimization/94785, tree-optimization/94802,
tree-optimization/94994, tree-optimization/95401,
tree-optimization/95582, tree-optimization/95771,
tree-optimization/96239, tree-optimization/96782,
tree-optimization/96928, tree-optimization/96930,
tree-optimization/98282, tree-optimization/98291,
tree-optimization/98302, tree-optimization/98308,
tree-optimization/98371, tree-optimization/98381,
tree-optimization/98393, tree-optimization/98428,
tree-optimization/98464, tree-optimization/98474,
tree-optimization/98513, tree-optimization/98514,
tree-optimization/98516, tree-optimization/98544,
tree-optimization/98560, tree-optimization/98568
* Wed Dec 23 2020 Jakub Jelinek <jakub@redhat.com> 11.0.0-0.11 * Wed Dec 23 2020 Jakub Jelinek <jakub@redhat.com> 11.0.0-0.11
- update from trunk - update from trunk
- PRs bootstrap/98300, bootstrap/98380, bootstrap/98412, c++/67343, - PRs bootstrap/98300, bootstrap/98380, bootstrap/98412, c++/67343,

View File

@ -1,118 +0,0 @@
2020-12-15 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/98282
* tree-ssa-pre.c (compute_avail): Don't try to adjust alias set
if different when ref1->opcode is not MEM_REF or TARGET_MEM_REF.
* g++.dg/opt/pr98282.C: New test.
--- gcc/tree-ssa-pre.c.jj 2020-11-30 10:48:31.000000000 +0100
+++ gcc/tree-ssa-pre.c 2020-12-15 10:51:51.061206572 +0100
@@ -4176,13 +4176,17 @@ compute_avail (void)
&& ref2->opcode != MEM_REF
&& ref2 != &operands[0])
--ref2;
- if ((ref1->opcode == TARGET_MEM_REF
- || ref1->opcode == MEM_REF)
- && (TYPE_ALIGN (ref1->type)
- > TYPE_ALIGN (ref2->type)))
- ref1->type
- = build_aligned_type (ref1->type,
- TYPE_ALIGN (ref2->type));
+ if (ref1->opcode == TARGET_MEM_REF
+ || ref1->opcode == MEM_REF)
+ {
+ if (TYPE_ALIGN (ref1->type)
+ > TYPE_ALIGN (ref2->type))
+ ref1->type
+ = build_aligned_type (ref1->type,
+ TYPE_ALIGN (ref2->type));
+ }
+ else
+ set = ref->set;
/* TBAA behavior is an obvious part so make sure
that the hashtable one covers this as well
by adjusting the ref alias set and its base. */
--- gcc/testsuite/g++.dg/opt/pr98282.C.jj 2020-12-15 12:26:25.868415230 +0100
+++ gcc/testsuite/g++.dg/opt/pr98282.C 2020-12-15 12:28:00.346353067 +0100
@@ -0,0 +1,80 @@
+// PR tree-optimization/98282
+// { dg-do compile { target c++11 } }
+// { dg-options "-O2" }
+
+template <typename> struct g;
+template <typename b> struct g<b &> { typedef b c; };
+template <typename b> typename g<b>::c &&d(b &&e) {
+ return static_cast<typename g<b>::c &&>(e);
+}
+void *operator new(__SIZE_TYPE__, void *f) { return f; }
+struct h;
+struct k {
+ using i = h *;
+};
+struct D {
+ k::i j;
+};
+struct p : D {
+ p(p &&) : D() {}
+};
+struct r {
+ using l = int;
+ r(r &&) : ad() {}
+ l *ad;
+};
+struct s {
+ static s m();
+};
+struct t {
+ template <typename ah> void operator=(ah);
+};
+struct I {
+ template <typename o> void q(o ai) {
+ *ai = aj();
+ s::m();
+ }
+ h aj();
+};
+template <typename...> class as;
+struct J {
+ int a;
+ char av;
+};
+template <typename...> struct aw : J {
+ void ax(...) {}
+};
+template <typename... ay, typename an, typename... n>
+struct aw<as<ay...>, an, n...> : aw<as<ay...>, n...> {
+ using az = as<ay...>;
+ using ba = aw<az, n...>;
+ char bb;
+ an &bc() { return *reinterpret_cast<an *>(this); }
+ void ax(az *bd) {
+ if (bb)
+ new (bd) an(d(bc()));
+ ba::ax(bd);
+ }
+};
+template <typename... n> struct as : aw<as<n...>, n...> {
+ as();
+ as(as &&be) { be.ax(this); }
+ void operator=(as be) { be.ax(this); }
+};
+struct h {
+ as<decltype(nullptr), r, p> bg;
+};
+using bh = t;
+struct u {
+ bh bj;
+};
+I bk();
+template <typename> void bl() {
+ h a;
+ bk().q(&a);
+}
+template <typename> void bn(int) {
+ u b;
+ b.bj = bl<int>;
+}
+void bp() { bn<int>(0); }

6
plans/ci.fmf Normal file
View File

@ -0,0 +1,6 @@
summary: CI Gating Plan
discover:
how: fmf
directory: tests
execute:
how: beakerlib

View File

@ -1,3 +1,3 @@
SHA512 (gcc-11.0.0-20201223.tar.xz) = 46bd2b601027ce420d5659e0e8638f9f3971eaf637960db9aced7a335ea234b761ae5b671ffc1fcee772c804cbdf9058346f461ad360019777feca89491afdd9 SHA512 (gcc-11.0.0-20210109.tar.xz) = eb3864cf6fef07077175fec2f1ce0b67e678da70a85ce09888f78d1587e7b4c94c398a19aa4a77c32ffdebc34e877ce28deb881c3545521f22c6b158c3087d5d
SHA512 (newlib-cygwin-50e2a63b04bdd018484605fbb954fd1bd5147fa0.tar.xz) = 002a48a7b689a81abbf16161bcaec001a842e67dfbe372e9e109092703bfc666675f16198f60ca429370e8850d564547dc505df81bc3aaca4ce6defbc014ad6c SHA512 (newlib-cygwin-50e2a63b04bdd018484605fbb954fd1bd5147fa0.tar.xz) = 002a48a7b689a81abbf16161bcaec001a842e67dfbe372e9e109092703bfc666675f16198f60ca429370e8850d564547dc505df81bc3aaca4ce6defbc014ad6c
SHA512 (nvptx-tools-5f6f343a302d620b0868edab376c00b15741e39e.tar.xz) = f6d10db94fa1570ae0f94df073fa3c73c8e5ee16d59070b53d94f7db0de8a031bc44d7f3f1852533da04b625ce758e022263855ed43cfc6867e0708d001e53c7 SHA512 (nvptx-tools-5f6f343a302d620b0868edab376c00b15741e39e.tar.xz) = f6d10db94fa1570ae0f94df073fa3c73c8e5ee16d59070b53d94f7db0de8a031bc44d7f3f1852533da04b625ce758e022263855ed43cfc6867e0708d001e53c7

View File

@ -1,9 +0,0 @@
#!/bin/bash
set -ex
gcc -x c $(rpm --eval %build_cflags) data/hello.c -o hello_c.out
./hello_c.out | grep -q "Hello World"
g++ -x c++ $(rpm --eval %build_cxxflags) data/hello.cpp -o hello_cpp.out
./hello_cpp.out | grep -q "Hello World"

View File

@ -1,5 +0,0 @@
#include <stdio.h>
int main() {
printf("Hello World!\n");
return 0;
}

View File

@ -1,5 +0,0 @@
#include <iostream>
int main() {
std::cout << "Hello World!\n";
return 0;
}

65
tests/smoke-test/Makefile Normal file
View File

@ -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 libstdc++-devel" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
rhts-lint $(METADATA)

3
tests/smoke-test/PURPOSE Normal file
View File

@ -0,0 +1,3 @@
PURPOSE of /tools/gcc/Sanity/smoke-test
Description: Basic smoke test.
Author: Marek Polacek <polacek@redhat.com>

View File

@ -0,0 +1,7 @@
int
main (void)
{
char *mem = __builtin_alloca (40);
__builtin___clear_cache (mem, mem + 40);
return 0;
}

7
tests/smoke-test/hello.c Normal file
View File

@ -0,0 +1,7 @@
#include <stdio.h>
int
main (void)
{
puts ("Hello World!");
}

View File

@ -0,0 +1,7 @@
#include <iostream>
int
main (void)
{
std::cout << "Hello, world!\n";
}

View File

@ -0,0 +1,3 @@
program hello
print *, "Hello World!"
end program hello

22
tests/smoke-test/main.fmf Normal file
View File

@ -0,0 +1,22 @@
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

View File

@ -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;
}

38
tests/smoke-test/quad.c Normal file
View File

@ -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;
}

125
tests/smoke-test/runtest.sh Executable file
View File

@ -0,0 +1,125 @@
#!/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

View File

@ -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;
}

34
tests/smoke-test/tm.c Normal file
View File

@ -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 );
}

View File

@ -1,14 +0,0 @@
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
required_packages:
- redhat-rpm-config
- annobin
tests:
- build_hello_world:
dir: .
run: "./build_hello_world.sh"