Run llvm test-suite after building

This commit is contained in:
Tom Stellard 2017-02-22 16:24:21 +00:00
parent f38da92e21
commit ce584ee113
4 changed files with 85 additions and 1 deletions

1
.gitignore vendored
View File

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

View File

@ -0,0 +1,43 @@
From 3306314bccdb3429a58fca198bec8d1a01cdf170 Mon Sep 17 00:00:00 2001
From: Matthias Braun <matze@braunis.de>
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

View File

@ -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 <tstellar@redhat.com> - 4.0.0-4
- Run llvm test-suite
* Mon Mar 27 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-3
- Enable eh/rtti, which are required by lldb.

View File

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