Move llvm-test-suite into a sub-package
This will allow it to be run by CI systems instead of during the %check phase.
This commit is contained in:
parent
68eed61006
commit
52c2187ff7
2
.gitignore
vendored
2
.gitignore
vendored
@ -39,3 +39,5 @@
|
|||||||
/cfe-7.0.0rc1.src.tar.xz
|
/cfe-7.0.0rc1.src.tar.xz
|
||||||
/test-suite-7.0.0rc1.src.tar.xz
|
/test-suite-7.0.0rc1.src.tar.xz
|
||||||
/clang-tools-extra-7.0.0rc1.src.tar.xz
|
/clang-tools-extra-7.0.0rc1.src.tar.xz
|
||||||
|
/test-suite-7.0.0rc1.src.fedora.tar.gz
|
||||||
|
/test-suite-7.0.0rc1.src.fedora.tar.xz
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
From 2ebadefad7d5b8d6770fc135f1ad48059a5ac3b5 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tom Stellard <tstellar@redhat.com>
|
||||||
|
Date: Fri, 17 Aug 2018 20:12:53 -0700
|
||||||
|
Subject: [PATCH] ABI-Testsuite: Force the old c++11 ABI in mangling/test.xpp
|
||||||
|
|
||||||
|
The check lines for this test assume the old c++11 ABI.
|
||||||
|
---
|
||||||
|
ABI-Testsuite/test/mangling/test.xpp | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/ABI-Testsuite/test/mangling/test.xpp b/ABI-Testsuite/test/mangling/test.xpp
|
||||||
|
index e7f4e00..b39e284 100755
|
||||||
|
--- a/ABI-Testsuite/test/mangling/test.xpp
|
||||||
|
+++ b/ABI-Testsuite/test/mangling/test.xpp
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
// This file is distributed under the University of Illinois Open Source License.
|
||||||
|
// See LICENSE.TXT for details.
|
||||||
|
-// RUN: cxx_compiler cxx_11 -c %s -o %t.o
|
||||||
|
+// RUN: cxx_compiler cxx_11 -D_GLIBCXX_USE_CXX11_ABI=0 -c %s -o %t.o
|
||||||
|
// RUN: bindump %t.o | FileCheck -allow-deprecated-dag-overlap prefixes %s
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
28
0001-Fix-CLAMR-build-with-newer-libstdc.patch
Normal file
28
0001-Fix-CLAMR-build-with-newer-libstdc.patch
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
From b997a61df6094d258db94393d378282e039ebe13 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tom Stellard <tstellar@redhat.com>
|
||||||
|
Date: Fri, 17 Aug 2018 16:00:52 -0700
|
||||||
|
Subject: [PATCH] Fix CLAMR build with newer libstdc++
|
||||||
|
|
||||||
|
---
|
||||||
|
MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h b/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h
|
||||||
|
index 138704f..9db368d 100644
|
||||||
|
--- a/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h
|
||||||
|
+++ b/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h
|
||||||
|
@@ -99,9 +99,9 @@ struct malloc_plus_memory_entry {
|
||||||
|
|
||||||
|
struct cmp_str
|
||||||
|
{
|
||||||
|
- bool operator()(char const *a, char const *b)
|
||||||
|
+ bool operator()(const string &a, const string &b)
|
||||||
|
{
|
||||||
|
- return strcmp(a, b) < 0;
|
||||||
|
+ return a.compare(b) < 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
59
clang.spec
59
clang.spec
@ -55,11 +55,11 @@
|
|||||||
|
|
||||||
%global clang_srcdir cfe-%{version}%{?rc_ver:rc%{rc_ver}}.src
|
%global clang_srcdir cfe-%{version}%{?rc_ver:rc%{rc_ver}}.src
|
||||||
%global clang_tools_srcdir clang-tools-extra-%{version}%{?rc_ver:rc%{rc_ver}}.src
|
%global clang_tools_srcdir clang-tools-extra-%{version}%{?rc_ver:rc%{rc_ver}}.src
|
||||||
%global test_suite_srcdir test-suite-%{version}%{?rc_ver:rc%{rc_ver}}.src
|
%global test_suite_srcdir test-suite-%{version}%{?rc_ver:rc%{rc_ver}}.src.fedora
|
||||||
|
|
||||||
Name: %pkg_name
|
Name: %pkg_name
|
||||||
Version: %{maj_ver}.%{min_ver}.%{patch_ver}
|
Version: %{maj_ver}.%{min_ver}.%{patch_ver}
|
||||||
Release: 0.3.rc%{rc_ver}%{?dist}
|
Release: 0.4.rc%{rc_ver}%{?dist}
|
||||||
Summary: A C language family front-end for LLVM
|
Summary: A C language family front-end for LLVM
|
||||||
|
|
||||||
License: NCSA
|
License: NCSA
|
||||||
@ -67,7 +67,14 @@ URL: http://llvm.org
|
|||||||
Source0: http://%{?rc_ver:pre}releases.llvm.org/%{version}/%{?rc_ver:rc%{rc_ver}}/%{clang_srcdir}.tar.xz
|
Source0: http://%{?rc_ver:pre}releases.llvm.org/%{version}/%{?rc_ver:rc%{rc_ver}}/%{clang_srcdir}.tar.xz
|
||||||
%if !0%{?compat_build}
|
%if !0%{?compat_build}
|
||||||
Source1: http://llvm.org/releases/%{version}/%{clang_tools_srcdir}.tar.xz
|
Source1: http://llvm.org/releases/%{version}/%{clang_tools_srcdir}.tar.xz
|
||||||
Source2: http://llvm.org/releases/%{version}/%{test_suite_srcdir}.tar.xz
|
|
||||||
|
# The LLVM Test Suite contains progrms with "BAD" or unknown licenses which should
|
||||||
|
# be removed. Some of the unknown licenses may be OK, but until they are reviewed,
|
||||||
|
# we will remove them.
|
||||||
|
# Use the pkg_test_suite.sh script to generate the test-suite tarball:
|
||||||
|
# wget http://llvm.org/releases/%%{version}/%%{test_suite_srcdir}.tar.xz
|
||||||
|
# ./pkg_test_suite.sh %%{test_suite_srcdir}.tar.xz
|
||||||
|
Source2: %{test_suite_srcdir}.tar.xz
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
Source100: clang-config.h
|
Source100: clang-config.h
|
||||||
@ -78,6 +85,10 @@ Patch2: 0001-Driver-Prefer-vendor-supplied-gcc-toolchain.patch
|
|||||||
# This was merged into the release_70 branch after 7.0.0-rc1
|
# This was merged into the release_70 branch after 7.0.0-rc1
|
||||||
Patch3: 0001-Merging-r338627.patch
|
Patch3: 0001-Merging-r338627.patch
|
||||||
|
|
||||||
|
# Test suite Patches
|
||||||
|
Patch100: 0001-Fix-CLAMR-build-with-newer-libstdc.patch
|
||||||
|
Patch101: 0001-ABI-Testsuite-Force-the-old-c-11-ABI-in-mangling-tes.patch
|
||||||
|
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
BuildRequires: cmake
|
BuildRequires: cmake
|
||||||
@ -108,11 +119,7 @@ BuildRequires: python3-lit
|
|||||||
# /usr/bin/python2, so we must have the python2 version of lit.
|
# /usr/bin/python2, so we must have the python2 version of lit.
|
||||||
# FIXME: We should find a way to not depend on python2-lit.
|
# FIXME: We should find a way to not depend on python2-lit.
|
||||||
BuildRequires: python2-lit
|
BuildRequires: python2-lit
|
||||||
|
BuildRequires: python2-rpm-macros
|
||||||
BuildRequires: zlib-devel
|
|
||||||
BuildRequires: tcl
|
|
||||||
BuildRequires: python2-virtualenv
|
|
||||||
BuildRequires: libstdc++-static
|
|
||||||
BuildRequires: python3-sphinx
|
BuildRequires: python3-sphinx
|
||||||
BuildRequires: libatomic
|
BuildRequires: libatomic
|
||||||
|
|
||||||
@ -198,6 +205,22 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
|||||||
Requires: python2
|
Requires: python2
|
||||||
%description -n python2-clang
|
%description -n python2-clang
|
||||||
%{summary}.
|
%{summary}.
|
||||||
|
|
||||||
|
%package -n llvm-test-suite
|
||||||
|
Summary: C/C++ Compiler Test Suite
|
||||||
|
License: NCSA, MIT, GPL, Python
|
||||||
|
Requires: cmake
|
||||||
|
Requires: libstdc++-static
|
||||||
|
Requires: python3-lit = 0.7.0
|
||||||
|
# ABI-Testsuite requires python2-lit
|
||||||
|
Requires: python2-lit = 0.7.0
|
||||||
|
Requires: llvm
|
||||||
|
Requires: tcl
|
||||||
|
|
||||||
|
%description -n llvm-test-suite
|
||||||
|
C/C++ Compiler Test Suite that is mantained as an LLVM sub-project. This test
|
||||||
|
suite can be run with any compiler, not just clang.
|
||||||
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
|
||||||
@ -208,6 +231,8 @@ Requires: python2
|
|||||||
%setup -T -q -b 1 -n %{clang_tools_srcdir}
|
%setup -T -q -b 1 -n %{clang_tools_srcdir}
|
||||||
|
|
||||||
%setup -T -q -b 2 -n %{test_suite_srcdir}
|
%setup -T -q -b 2 -n %{test_suite_srcdir}
|
||||||
|
%patch100 -p1 -b .build-fix
|
||||||
|
%patch101 -p1 -b .old-abi-fix
|
||||||
|
|
||||||
%setup -q -n %{clang_srcdir}
|
%setup -q -n %{clang_srcdir}
|
||||||
%patch0 -p1 -b .lit-search-path
|
%patch0 -p1 -b .lit-search-path
|
||||||
@ -319,6 +344,10 @@ rm -vf %{buildroot}%{_datadir}/clang/bash-autocomplete.sh
|
|||||||
# Add clang++-{version} sylink
|
# Add clang++-{version} sylink
|
||||||
ln -s %{_bindir}/clang++ %{buildroot}%{_bindir}/clang++-%{maj_ver}
|
ln -s %{_bindir}/clang++ %{buildroot}%{_bindir}/clang++-%{maj_ver}
|
||||||
|
|
||||||
|
# Install test suite
|
||||||
|
mkdir -p %{buildroot}%{_datadir}/llvm-test-suite/
|
||||||
|
cp -R %{_builddir}/%{test_suite_srcdir}/* %{buildroot}%{_datadir}/llvm-test-suite
|
||||||
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%check
|
%check
|
||||||
@ -333,14 +362,6 @@ PATH=%{_libdir}/llvm:$PATH make check-clang || \
|
|||||||
false
|
false
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
mkdir -p %{_builddir}/%{test_suite_srcdir}/_build
|
|
||||||
cd %{_builddir}/%{test_suite_srcdir}/_build
|
|
||||||
|
|
||||||
# FIXME: Using the cmake macro adds -Werror=format-security to the C/CXX flags,
|
|
||||||
# which causes the test suite to fail to build.
|
|
||||||
cmake .. -DCMAKE_C_COMPILER=%{buildroot}/usr/bin/clang \
|
|
||||||
-DCMAKE_CXX_COMPILER=%{buildroot}/usr/bin/clang++
|
|
||||||
make %{?_smp_mflags} check || :
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
|
||||||
@ -407,8 +428,14 @@ make %{?_smp_mflags} check || :
|
|||||||
%files -n python2-clang
|
%files -n python2-clang
|
||||||
%{python2_sitelib}/clang/
|
%{python2_sitelib}/clang/
|
||||||
|
|
||||||
|
%files -n llvm-test-suite
|
||||||
|
%{_datadir}/llvm-test-suite/
|
||||||
|
|
||||||
%endif
|
%endif
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Aug 17 2018 Tom Stellard <tstellar@redhat.com> - 7.0.0-0.4.rc1
|
||||||
|
- Move llvm-test-suite into a sub-package
|
||||||
|
|
||||||
* Fri Aug 17 2018 Tom Stellard <tstellar@redhat.com> - 7.0.0-0.3.rc1
|
* Fri Aug 17 2018 Tom Stellard <tstellar@redhat.com> - 7.0.0-0.3.rc1
|
||||||
- Recommend the same version of compiler-rt
|
- Recommend the same version of compiler-rt
|
||||||
|
|
||||||
|
44
pkg_test_suite.sh
Normal file
44
pkg_test_suite.sh
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
|
||||||
|
set -ex
|
||||||
|
tmpdir=`mktemp -d`
|
||||||
|
currentdir=`pwd`
|
||||||
|
|
||||||
|
tar -C $tmpdir -xJf $1
|
||||||
|
|
||||||
|
test_suite_src=`echo $1 | cut -d . -f 1-4`
|
||||||
|
pushd $tmpdir
|
||||||
|
test -d $test_suite_src
|
||||||
|
|
||||||
|
|
||||||
|
UNKNOWN="\
|
||||||
|
MultiSource/Benchmarks/mediabench/ \
|
||||||
|
MultiSource/Applications/JM/"
|
||||||
|
|
||||||
|
#MallocBench/{espresso,cfrac} might be OK
|
||||||
|
BAD="\
|
||||||
|
MultiSource/Benchmarks/MallocBench/ \
|
||||||
|
MultiSource/Benchmarks/7zip/"
|
||||||
|
|
||||||
|
POSSIBLY_BAD="\
|
||||||
|
MultiSource/Benchmarks/Olden/ \
|
||||||
|
MultiSource/Benchmarks/Fhourstones/ \
|
||||||
|
MultiSource/Benchmarks/ASCI_Purple/SMG2000/ \
|
||||||
|
MultiSource/Benchmarks/Fhourstones-3.1/ \
|
||||||
|
MultiSource/Benchmarks/McCat/ \
|
||||||
|
MultiSource/Applications/spiff/"
|
||||||
|
|
||||||
|
|
||||||
|
for f in $UNKNOWN $BAD $POSSIBLY_BAD; do
|
||||||
|
test -d $test_suite_src/$f
|
||||||
|
rm -Rf $test_suite_src/$f
|
||||||
|
basedir=`dirname $f`
|
||||||
|
dir=`basename $f`
|
||||||
|
cmake_file=$test_suite_src/$basedir/CMakeLists.txt
|
||||||
|
test -f $cmake_file
|
||||||
|
sed -i s/add_subdirectory\($dir\)//g $cmake_file
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
tar --transform=s/$test_suite_src/$test_suite_src.fedora/ --show-transformed-names -cJf $currentdir/$test_suite_src.fedora.tar.xz $test_suite_src
|
||||||
|
pushd
|
||||||
|
rm -Rf $tmpdir
|
2
sources
2
sources
@ -1,3 +1,3 @@
|
|||||||
SHA512 (cfe-7.0.0rc1.src.tar.xz) = 97d8775c36c0883861d6b0732451c3d431d30dbe39d405b2755d87a4d8d217fafea7becd31765dca8d5b7ae0dc33785ada10c6f60331a70d5294b22f00242cd0
|
SHA512 (cfe-7.0.0rc1.src.tar.xz) = 97d8775c36c0883861d6b0732451c3d431d30dbe39d405b2755d87a4d8d217fafea7becd31765dca8d5b7ae0dc33785ada10c6f60331a70d5294b22f00242cd0
|
||||||
SHA512 (test-suite-7.0.0rc1.src.tar.xz) = fbfeefdd27ff9e8e323214a77fd34bc661f7869b62188d8fe86308396ca2dedb757dd3b8f00d4c3978f727ba35b64797832dcfadff9882a7418b2aa74616aca8
|
SHA512 (test-suite-7.0.0rc1.src.fedora.tar.xz) = ed31281b7119d4f9b6b3c65a6c872a7987fe18a589a485485a5b715620ffef4b116a6f72fac039c6638ea2e981b348cad9d6908d111661db3df8bfe96f64e795
|
||||||
SHA512 (clang-tools-extra-7.0.0rc1.src.tar.xz) = a7d467b714731f54ed08019b698f7e301060ca84f0fcb23494c374a0d3b6e9d4d3f3bfd62ed83888574a29aff3fb5a718b5af85f59abd49a2683dbb543c7e033
|
SHA512 (clang-tools-extra-7.0.0rc1.src.tar.xz) = a7d467b714731f54ed08019b698f7e301060ca84f0fcb23494c374a0d3b6e9d4d3f3bfd62ed83888574a29aff3fb5a718b5af85f59abd49a2683dbb543c7e033
|
||||||
|
@ -5,8 +5,17 @@
|
|||||||
- classic
|
- classic
|
||||||
required_packages:
|
required_packages:
|
||||||
- clang
|
- clang
|
||||||
|
- llvm-test-suite
|
||||||
|
- ninja-build
|
||||||
- gcc-x86_64-linux-gnu
|
- gcc-x86_64-linux-gnu
|
||||||
|
- which
|
||||||
tests:
|
tests:
|
||||||
- rhbz#482491:
|
- rhbz#482491:
|
||||||
dir: ./
|
dir: ./
|
||||||
run: echo "int main(){}" | clang -x c -
|
run: echo "int main(){}" | clang -x c -
|
||||||
|
- llvm-test-suite:
|
||||||
|
dir: ./
|
||||||
|
run: cd $(mktemp -d) && cmake -G Ninja /usr/share/llvm-test-suite/ -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang && ninja check
|
||||||
|
- llvm-abi-test-suite:
|
||||||
|
dir: ./
|
||||||
|
run: cd /usr/share/llvm-test-suite/ABI-Testsuite/ && python2 linux-x86.py clang test -v --path /usr/lib64/llvm/
|
||||||
|
Loading…
Reference in New Issue
Block a user