From ce584ee113a731373120387f66aec6e12ef3d913 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Apr 28 2017 16:12:39 +0000 Subject: Run llvm test-suite after building --- diff --git a/.gitignore b/.gitignore index 7e1f2b3..aa972fa 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ /clang-tools-extra-3.9.1.src.tar.xz /cfe-4.0.0.src.tar.xz /clang-tools-extra-4.0.0.src.tar.xz +/test-suite-4.0.0.src.tar.xz diff --git a/0001-litsupport-Add-compatibility-cludge-so-it-still-work.patch b/0001-litsupport-Add-compatibility-cludge-so-it-still-work.patch new file mode 100644 index 0000000..adaa354 --- /dev/null +++ b/0001-litsupport-Add-compatibility-cludge-so-it-still-work.patch @@ -0,0 +1,43 @@ +From 3306314bccdb3429a58fca198bec8d1a01cdf170 Mon Sep 17 00:00:00 2001 +From: Matthias Braun +Date: Fri, 13 Jan 2017 18:36:20 +0000 +Subject: [PATCH] litsupport: Add compatibility cludge so it still works with + the pypy version of lit + +git-svn-id: https://llvm.org/svn/llvm-project/test-suite/trunk@291933 91177308-0d34-0410-b5e6-96231b3b80d8 +--- + litsupport/testfile.py | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/litsupport/testfile.py b/litsupport/testfile.py +index d1d234a..7223938 100644 +--- a/litsupport/testfile.py ++++ b/litsupport/testfile.py +@@ -27,16 +27,19 @@ def parse(context, filename): + runscript = [] + verifyscript = [] + metricscripts = {} +- keywords = ['PREPARE:', 'RUN:', 'VERIFY:', 'METRIC:'] ++ # Note that we keep both "RUN" and "RUN:" in the list to stay compatible ++ # with older lit versions. ++ keywords = ['PREPARE:', 'PREPARE', 'RUN:', 'RUN', 'VERIFY:', 'VERIFY', ++ 'METRIC:', 'METRIC'] + for line_number, command_type, ln in \ + parseIntegratedTestScriptCommands(filename, keywords): +- if command_type == 'PREPARE:': ++ if command_type.startswith('PREPARE'): + _parseShellCommand(preparescript, ln) +- elif command_type == 'RUN:': ++ elif command_type.startswith('RUN'): + _parseShellCommand(runscript, ln) +- elif command_type == 'VERIFY:': ++ elif command_type.startswith('VERIFY'): + _parseShellCommand(verifyscript, ln) +- elif command_type == 'METRIC:': ++ elif command_type.startswith('METRIC'): + metric, ln = ln.split(':', 1) + metricscript = metricscripts.setdefault(metric.strip(), list()) + _parseShellCommand(metricscript, ln) +-- +2.9.3 + diff --git a/clang.spec b/clang.spec index 363c322..00208b7 100644 --- a/clang.spec +++ b/clang.spec @@ -18,19 +18,28 @@ %{_bindir}/clang-import-test \ %{_bindir}/clang-offload-bundler +%if 0%{?fedora} +%bcond_without python3 +%else +%bcond_with python3 +%endif + Name: clang Version: 4.0.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A C language family front-end for LLVM License: NCSA URL: http://llvm.org Source0: http://llvm.org/releases/%{version}/cfe-%{version}.src.tar.xz Source1: http://llvm.org/releases/%{version}/clang-tools-extra-%{version}.src.tar.xz +Source2: http://llvm.org/releases/%{version}/test-suite-%{version}.src.tar.xz Source100: clang-config.h Patch0: 0001-CMake-Fix-pthread-handling-for-out-of-tree-builds.patch +# This patch is required when the test suite is using python-lit 0.5.0. +Patch1: 0001-litsupport-Add-compatibility-cludge-so-it-still-work.patch BuildRequires: cmake BuildRequires: llvm-devel = %{version} @@ -38,6 +47,19 @@ BuildRequires: libxml2-devel BuildRequires: llvm-static = %{version} BuildRequires: perl-generators BuildRequires: ncurses-devel + +# These build dependencies are required for the test suite. +%if %with python3 +BuildRequires: python3-lit +%else +BuildRequires: python2-lit +%endif + +BuildRequires: zlib-devel +BuildRequires: tcl +BuildRequires: python-virtualenv +BuildRequires: libstdc++-static + Requires: %{name}-libs%{?_isa} = %{version}-%{release} # clang requires gcc, clang++ requires libstdc++-devel @@ -97,6 +119,10 @@ A set of extra tools built using Clang's tooling API. %prep %setup -T -q -b 1 -n clang-tools-extra-%{version}.src %patch0 -p1 -b .pthread-fix + +%setup -T -q -b 2 -n test-suite-%{version}.src +%patch1 -p1 -b .lit-fix + %setup -q -n cfe-%{version}.src mv ../clang-tools-extra-%{version}.src tools/extra @@ -159,6 +185,16 @@ rm -vf %{buildroot}%{_datadir}/clang/clang-format-diff.py* #cd _build #make check-all +mkdir -p %{_builddir}/test-suite-%{version}.src/_build +cd %{_builddir}/test-suite-%{version}.src/_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 + + %files %{_libdir}/clang/ %{clang_binaries} @@ -190,6 +226,9 @@ rm -vf %{buildroot}%{_datadir}/clang/clang-format-diff.py* %{_bindir}/modularize %changelog +* Mon Apr 03 2017 Tom Stellard - 4.0.0-4 +- Run llvm test-suite + * Mon Mar 27 2017 Tom Stellard - 4.0.0-3 - Enable eh/rtti, which are required by lldb. diff --git a/sources b/sources index 356e40e..85a33dc 100644 --- a/sources +++ b/sources @@ -1,2 +1,3 @@ SHA512 (cfe-4.0.0.src.tar.xz) = a0d9972ec337a5c105fcbe7abc4076ba1e580f28908a3318f43bbfe59143f446ed5b78dad210f624145d7e5a3d56c15bfead78826c068422b60120fa1cfa482a SHA512 (clang-tools-extra-4.0.0.src.tar.xz) = 2f9aed5ff7e175b730802961f9ce0aa6376ce78d905839e60536b6d166f68dc31d4420a668ed1e08f3601a5fefa8f7514172daaf77eb325fecd00e55f56e5af4 +SHA512 (test-suite-4.0.0.src.tar.xz) = 1ec2bc3307d8047ffe877e86ebac69f8f1f3ac062d789c2e341b4d4be4b1973d02ab398879cd42faf3346b8952991f00f4f77e4e63604718241cc5f5abb822b3