Compare commits
182 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8421b02273 | ||
|
|
ce3e5b6a0d | ||
|
|
61dd89e407 | ||
|
|
3fd65b9990 | ||
|
|
6f3ff93a5f | ||
|
|
48d9d59fc6 | ||
|
|
f57ec3b76c | ||
|
|
18972ea7ad | ||
|
|
6df13a6c10 | ||
|
|
b5095271a1 | ||
|
|
4f4c834e22 | ||
|
|
4c4d9b3bc5 | ||
|
|
140490cb76 | ||
|
|
dc54daea6f | ||
|
|
03f0cdd926 | ||
|
|
e4d1e99d30 | ||
|
|
961500a660 | ||
|
|
d342d3c08b | ||
|
|
a7f0d01a63 | ||
|
|
a84cc4e933 | ||
|
|
8309550db6 | ||
|
|
f2da47a2ca | ||
|
|
4f6d648643 | ||
|
|
6018ff44fc | ||
|
|
7baa9af2da | ||
|
|
ed30e923cc | ||
|
|
7dfda355f9 | ||
|
|
d48991f42a | ||
|
|
5f75e69cbd | ||
|
|
91290fc5b1 | ||
|
|
38d826adb5 | ||
|
|
f2b09a5e62 | ||
|
|
3e6d2aa917 | ||
|
|
03356db82d | ||
|
|
d40ca8022a | ||
|
|
d2c29f2096 | ||
|
|
cce3cc4dde | ||
|
|
023ec1ee03 | ||
|
|
7b47ede5cd | ||
|
|
3ee1395888 | ||
|
|
c5c7ff94a3 | ||
|
|
bbc0f57af4 | ||
|
|
b7d140d50e | ||
|
|
9fbc967ffd | ||
|
|
3e6638c72c | ||
|
|
f18276601b | ||
|
|
4ff8a6a55f | ||
|
|
e851d75dcc | ||
|
|
40fef0bd32 | ||
|
|
25257b851b | ||
|
|
0abd69aae9 | ||
|
|
b69c51a4a0 | ||
|
|
47cc23d2bb | ||
|
|
4d92417571 | ||
|
|
7b5681ac95 | ||
|
|
de1663d7a9 | ||
|
|
c140bdf103 | ||
|
|
336e421c1a | ||
|
|
a2b93f39c8 | ||
|
|
8f44f59b6f | ||
|
|
8e5e183f85 | ||
|
|
d69918d2f8 | ||
|
|
a9a9883a60 | ||
|
|
85fc2de396 | ||
|
|
cda9761d2e | ||
|
|
c8d36d768f | ||
|
|
71a2b1c3bf | ||
|
|
bf7e2faa36 | ||
|
|
c45fd5b631 | ||
|
|
9080b2716a | ||
|
|
07526ca7fa | ||
|
|
2554ce3aa3 | ||
|
|
2b2e06a7e1 | ||
|
|
06436d11ba | ||
|
|
dade06cfdd | ||
|
|
5100dc7cf0 | ||
|
|
3359782211 | ||
|
|
7ab65858ab | ||
|
|
e5e8b03b9f | ||
|
|
ca2401025f | ||
|
|
f741479086 | ||
|
|
af1c69a51d | ||
|
|
be814a6310 | ||
|
|
3d9db8ae35 | ||
|
|
4359d29013 | ||
|
|
f3053280b2 | ||
|
|
5e5ec12425 | ||
|
|
3449426c91 | ||
|
|
0297643810 | ||
|
|
0f16004a0a | ||
|
|
b3c624504c | ||
|
|
6e7caab25c | ||
|
|
84b1265f72 | ||
|
|
487364d65b | ||
|
|
020d712305 | ||
|
|
acc90e7a06 | ||
|
|
f58e59b394 | ||
|
|
0d4c50b5e0 | ||
|
|
3e0a05df6c | ||
|
|
5a88effc47 | ||
|
|
4a8c55b532 | ||
|
|
2b4086412b | ||
|
|
bf6cf7375d | ||
|
|
fa8bc5eb0b | ||
|
|
443a26a24d | ||
|
|
acbe4aee52 | ||
|
|
6c3812f472 | ||
|
|
c419262848 | ||
|
|
a07664eccf | ||
|
|
fa120530f1 | ||
|
|
23bd2ee6b2 | ||
|
|
defae03611 | ||
|
|
77be13cc41 | ||
|
|
598eead7e1 | ||
|
|
271a6a565d | ||
|
|
9c62e92982 | ||
|
|
be641c9e9a | ||
|
|
ab620ce7f0 | ||
|
|
c1eaab43ec | ||
|
|
ca5c810d9a | ||
|
|
3403ca384d | ||
|
|
bb6d566ab8 | ||
|
|
982bb6f065 | ||
|
|
082c661c48 | ||
|
|
ec1f44228b | ||
|
|
0e8ca2a543 | ||
|
|
ffe7fa64b2 | ||
|
|
c9cf4400a6 | ||
|
|
f37486b615 | ||
|
|
9f63297a4a | ||
|
|
60a9f71c70 | ||
|
|
3ff5b7451d | ||
|
|
1e0115c194 | ||
|
|
5a8ea6a930 | ||
|
|
e43607a0f6 | ||
|
|
5ac66c3693 | ||
|
|
6a33abfde8 | ||
|
|
22639249c6 | ||
|
|
2918649549 | ||
|
|
052a886fd0 | ||
|
|
fea3e11f64 | ||
|
|
de1d86b24b | ||
|
|
048eb66cf0 | ||
|
|
5a94d66325 | ||
|
|
4685483471 | ||
|
|
a0abe34748 | ||
|
|
6dcae89e8c | ||
|
|
7686cf01a1 | ||
|
|
8454ab8df6 | ||
|
|
75941bd254 | ||
|
|
3270f811ee | ||
|
|
af1b185754 | ||
|
|
af3dcbf8a1 | ||
|
|
24ce28afab | ||
|
|
2878c430d9 | ||
|
|
ec1522e35f | ||
|
|
208cf98117 | ||
|
|
7b73875f86 | ||
| 35ad3c3dc8 | |||
|
|
ab3d3a4e21 | ||
|
|
675b60ec17 | ||
|
|
fc28d8cd09 | ||
|
|
2c73313075 | ||
|
|
125e4514d1 | ||
|
|
a8cc88906c | ||
|
|
8c35ab8755 | ||
|
|
7744bcc340 | ||
|
|
acfc82b341 | ||
|
|
d552bd3f39 | ||
|
|
ef99cd915c | ||
|
|
83e10c9311 | ||
|
|
7f8a2c1490 | ||
|
|
d4f1efb913 | ||
| fd67fac3a6 | |||
| 59589a3599 | |||
|
|
061565d8fd | ||
|
|
c7a6ef0f24 | ||
|
|
39f92abcf4 | ||
|
|
ac62af341a | ||
|
|
1d620dc3b0 | ||
|
|
5cd5549121 | ||
|
|
56f24323b5 |
127 changed files with 2076 additions and 249 deletions
|
|
@ -12,3 +12,10 @@ repos:
|
|||
rev: 1.32.2
|
||||
hooks:
|
||||
- id: tmt-lint
|
||||
|
||||
- repo: https://github.com/koalaman/shellcheck-precommit
|
||||
rev: v0.10.0
|
||||
hooks:
|
||||
- id: shellcheck
|
||||
require_serial: true # Podman has trouble running concurrently
|
||||
args: ["--exclude=SC1091"] # Ignore "Not following" sourced scripts
|
||||
|
|
|
|||
50
README.md
50
README.md
|
|
@ -7,9 +7,13 @@ Tests are executed using TMT (Test Management Tool). The repository includes a
|
|||
TMT plan that runs all the tests by default. All the tests support the following
|
||||
context dimensions:
|
||||
|
||||
* `distro`
|
||||
* `arch`
|
||||
* `collection` (only applicable to RHEL 7)
|
||||
* `distro`: The distribution version running the tests (e.g. `rhel-9.6`,
|
||||
`fedora-42`, `centos-stream-10`)
|
||||
* `arch`: The hardware architecture of the host running the tests (e.g. `aarch64`,
|
||||
`s390x`, `x86_64`)
|
||||
* `compat`: Indicates a run for fedora compat-versioned packages (e.g. `llvm18`)
|
||||
* `snapshot`: Indicates a run for [llvm snapshots](
|
||||
https://github.com/fedora-llvm-team/llvm-snapshots) copr build.
|
||||
|
||||
To run the tests:
|
||||
```bash
|
||||
|
|
@ -93,6 +97,18 @@ tier: 1
|
|||
# - sometag
|
||||
```
|
||||
|
||||
### Test Tags
|
||||
|
||||
The following tags are used to control which tests are included or excluded in
|
||||
TMT plans. Please be cautious when adding or removing these tags, as they are
|
||||
used by plans in multiple repositories.
|
||||
|
||||
* `fedora-only`: The test applies to Fedora distros only.
|
||||
* `not-in-default`: Excludes the test from the default test plan. This is useful
|
||||
for resource-intensive tests that are better suited for a dedicated test plan
|
||||
or could potentially break the test system.
|
||||
* `multilib`: Requires 32-bit (i686) package dependencies.
|
||||
|
||||
### Avoid common errors using pre-commit
|
||||
|
||||
This project uses [`pre-commit`](https://pre-commit.com/)
|
||||
|
|
@ -108,3 +124,31 @@ Please install `pre-commit` using `pip install pre-commit` as described
|
|||
project and install the git hook scripts using `pre-commit install`. This will
|
||||
run pre-commit on every `git commit` that you make in this repository from now
|
||||
on.
|
||||
|
||||
## Test specific documentation
|
||||
|
||||
### kernel-ark-rebuild
|
||||
The `kernel-ark-rebuild` test is a special test that we use to ensure that clang,
|
||||
llvm, and lld builds do not break [Always Ready Kernel](
|
||||
https://gitlab.com/cki-project/kernel-ark) builds, which are done in Fedora
|
||||
Rawhide. This is a virtual test comprised of 4 tests corresponding to different
|
||||
build configurations for the kernel:
|
||||
|
||||
* base
|
||||
* base/lto
|
||||
* debug
|
||||
* debug/lto
|
||||
|
||||
Due to this, this test is not regularly run on PRs opened in tests/clang, as
|
||||
running the 4 tests can take about 6 hours. Instead, if you modify the test
|
||||
you are expected to run it on your own and provide the results in the Pull
|
||||
Request. A specific tmt test plan named `kernel-ark-gating.fmf` is provided for
|
||||
that. It can be run using Testing Farm with this command:
|
||||
```
|
||||
testing-farm request -c initiator=human -c distro=fedora-rawhide -c arch=<your-arch> \
|
||||
--compose Fedora-Rawhide --git-url <url-to-your-fork> --git-ref <your-pr-branch> \
|
||||
--plan kernel-ark-gating
|
||||
```
|
||||
You need an [API key](https://docs.testing-farm.io/Testing%20Farm/0.1/onboarding.html)
|
||||
to be able to use Testing Farm. If you don't have on, please ask for help running
|
||||
the test when opening a Pull Request.
|
||||
|
|
|
|||
31
plans/build-gating-alternatives.fmf
Normal file
31
plans/build-gating-alternatives.fmf
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#
|
||||
# Build/PR gating tests for LLD
|
||||
#
|
||||
# Compatible with various LLVM distributions:
|
||||
#
|
||||
# * Fedora (ursine packages)
|
||||
# * Centos 9 stream (ursine packages)
|
||||
# * RHEL-9 (ursine packages)
|
||||
# * RHEL-8 (Red Hat module)
|
||||
#
|
||||
|
||||
summary: LLD tests for build/PR gating, testing alternatives and spoiling the installation
|
||||
discover:
|
||||
how: fmf
|
||||
test: ld-alternative
|
||||
execute:
|
||||
how: tmt
|
||||
|
||||
adjust+:
|
||||
- because: "Plan to be ran when either executed locally, or executed by CI system to gate a build or PR."
|
||||
when: >-
|
||||
trigger is defined
|
||||
and trigger != commit
|
||||
and trigger != build
|
||||
enabled: false
|
||||
|
||||
- because: lld is not shipped in s390x on LLVM < 18
|
||||
enabled: false
|
||||
when: arch == s390x and distro ~< rhel-8.10
|
||||
- enabled: false
|
||||
when: arch == s390x and distro ~< rhel-9.5
|
||||
|
|
@ -7,7 +7,6 @@
|
|||
# * Centos 9 stream (ursine packages)
|
||||
# * RHEL-9 (ursine packages)
|
||||
# * RHEL-8 (Red Hat module)
|
||||
# * RHEL-7 (software collection)
|
||||
#
|
||||
|
||||
summary: LLVM tests for build/PR gating
|
||||
|
|
@ -39,7 +38,7 @@ adjust:
|
|||
discover:
|
||||
- name: llvm-tests
|
||||
how: fmf
|
||||
filter: "tag:-spoils-installation"
|
||||
filter: "tag:-not-in-default"
|
||||
execute:
|
||||
how: tmt
|
||||
provision:
|
||||
|
|
|
|||
18
plans/kernel-ark-gating.fmf
Normal file
18
plans/kernel-ark-gating.fmf
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
summary: Build latest kernel-ark with clang using different build configurations
|
||||
discover:
|
||||
how: fmf
|
||||
test: kernel-ark-build
|
||||
execute:
|
||||
how: tmt
|
||||
provision:
|
||||
hardware:
|
||||
memory: ">=16 GiB"
|
||||
cpu:
|
||||
cores: ">=8"
|
||||
|
||||
# We do not want to run this test on every pull request done to tests/clang.
|
||||
# Only allow to run manually when the test is really modified to prevent
|
||||
# using too much time and resources in non-related pull requests.
|
||||
adjust:
|
||||
- when: initiator is not defined or initiator != human
|
||||
enabled: false
|
||||
25
tests/abi-test-suite/main.fmf
Normal file
25
tests/abi-test-suite/main.fmf
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
summary: Run ABI tests from llvm-test-suite package
|
||||
duration: 1h
|
||||
|
||||
tag+:
|
||||
- fedora-only
|
||||
|
||||
adjust+:
|
||||
- because: "llvm-test-suite is available for Fedora, not RHEL/CentOS"
|
||||
when: >-
|
||||
distro == rhel
|
||||
or distro == centos
|
||||
enabled: false
|
||||
|
||||
- because: ABI testsuite only supported in x86*
|
||||
enabled: false
|
||||
when: arch != x86_64
|
||||
|
||||
- because: "llvm test suite not built for compat packages"
|
||||
enabled: false
|
||||
when: compat is defined
|
||||
|
||||
require+:
|
||||
- clang
|
||||
- llvm-test-suite
|
||||
- python3
|
||||
14
tests/abi-test-suite/test.sh
Executable file
14
tests/abi-test-suite/test.sh
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
|
||||
testsuite_dir="/usr/share/llvm-test-suite/"
|
||||
compiler="clang"
|
||||
|
||||
set -xe
|
||||
|
||||
tmpdir=$(mktemp -d -p /var/tmp)
|
||||
pushd "$tmpdir"
|
||||
cp -r $testsuite_dir/ABI-Testsuite .
|
||||
cd ABI-Testsuite
|
||||
python3 linux-x86.py $compiler test -v
|
||||
popd
|
||||
rm -rf "$tmpdir"
|
||||
|
|
@ -4,8 +4,6 @@ duration: 1m
|
|||
require+:
|
||||
- binutils
|
||||
tier: 1
|
||||
extra-summary: /tools/llvm/binutils-plugin-ar
|
||||
extra-task: /tools/llvm/binutils-plugin-ar
|
||||
|
||||
adjust+:
|
||||
# This will not work in RHEL-7. Check for further information:
|
||||
|
|
@ -14,4 +12,6 @@ adjust+:
|
|||
enabled: false
|
||||
when: distro == rhel-7
|
||||
|
||||
extra-nitrate: TC#0614092
|
||||
- because: compat llvm-libs does not install LLVMgold.so in bfd-plugins dir
|
||||
enabled: false
|
||||
when: compat is defined
|
||||
|
|
|
|||
22
tests/bolt-sanity/main.fmf
Normal file
22
tests/bolt-sanity/main.fmf
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
summary: Sanity check that llvm-bolt works
|
||||
tier: 1
|
||||
|
||||
tag+:
|
||||
- fedora-only
|
||||
|
||||
adjust+:
|
||||
- because: "llvm-bolt is available for Fedora, not RHEL/CentOS"
|
||||
when: distro != fedora
|
||||
enabled: false
|
||||
|
||||
- because: "llvm-bolt only supports x86_64 and aarch64"
|
||||
when: arch != x86_64 and arch != aarch64
|
||||
enabled: false
|
||||
|
||||
- because: "llvm-bolt not shipped in compat packages"
|
||||
when: compat is defined
|
||||
enabled: false
|
||||
|
||||
require+:
|
||||
- llvm-bolt
|
||||
- clang
|
||||
8
tests/bolt-sanity/test.sh
Executable file
8
tests/bolt-sanity/test.sh
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh -eux
|
||||
|
||||
echo "int main() { return 0; }" > test.c
|
||||
clang -Wl,--emit-relocs test.c
|
||||
llvm-bolt a.out -instrument -o a.instrumented.out
|
||||
./a.instrumented.out
|
||||
llvm-bolt a.out -data /tmp/prof.fdata -o a.bolt.out
|
||||
./a.bolt.out
|
||||
17
tests/broken-symlinks/main.fmf
Normal file
17
tests/broken-symlinks/main.fmf
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
summary: Test that compiler-rt does not contain broken symlinks
|
||||
tier: 1
|
||||
framework: beakerlib
|
||||
require+:
|
||||
- yum-utils
|
||||
- python3-dnf
|
||||
|
||||
link+:
|
||||
- verifies: https://issues.redhat.com/browse/RHEL-7375
|
||||
|
||||
adjust+:
|
||||
# Broken symlinks were fixed with Clang Resource directory moving in LLVM 17:
|
||||
# https://fedoraproject.org/wiki/Changes/LLVM-17#Detailed_Description
|
||||
# There are no plans to backport that, so we disable the test
|
||||
# in distros where LLVM < 17.
|
||||
- enabled: false
|
||||
when: distro ~<= rhel-9.3
|
||||
55
tests/broken-symlinks/test.sh
Executable file
55
tests/broken-symlinks/test.sh
Executable file
|
|
@ -0,0 +1,55 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
declare tmp
|
||||
rlRun "tmp=$(mktemp -d)" 0 "Create a temp dir"
|
||||
# Get the compiler-rt package name from the tmt required packages, which should
|
||||
# address the issue of getting the correct name regardless it's a compat package
|
||||
# or not. The package can be named either compiler-rt or compiler-rt[0-9]+
|
||||
rlRun "COMPILER_RT=$(rlGetYAMLdeps | tr ' ' '\n' | grep -E "compiler-rt[[:digit:]]*$")"
|
||||
# Make sure to get only the main arch, so we can deal with multilib issues.
|
||||
rlRun "COMPILER_RT_NVR=$(rpm -q "${COMPILER_RT}" | grep "$(uname -m)")"
|
||||
# Use dnf repoquery --installed so we *don't* query any repos but the
|
||||
# local rpm database instead. That should handle packages installed
|
||||
# using rpm, that are not in repos, and avoid timeouts if repo connection
|
||||
# is slow.
|
||||
# dnf5 drops support of --resolve in favor of --providers-of=<attribute>
|
||||
# but --installed does query the repos anyway. In systems with dnf5 we
|
||||
# fall back to dnf4 python bindings (using dnf-3) to workaround this.
|
||||
# Check https://src.fedoraproject.org/tests/compiler-rt/issue/16
|
||||
rlRun "dnf-3 repoquery --installed --depends --resolve $COMPILER_RT_NVR > $tmp/dependencies.log"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
for file in $(rpm -ql "$COMPILER_RT_NVR"); do
|
||||
# Skip iteration if the file is not a symlink
|
||||
[[ -L $file ]] || continue
|
||||
|
||||
# Check if the symlink resolves to a valid file. If not, it's a failure
|
||||
if [[ ! -e $file ]]; then
|
||||
rlFail "$file is a dangling symlink"
|
||||
continue
|
||||
fi
|
||||
|
||||
# Up to this point, the linked file exists.
|
||||
# If the owner of the target compiler-rt package itself that's
|
||||
# correct and we can skip to the next file.
|
||||
target=$(readlink -f "$file")
|
||||
OWNER_NVR=$(rpm -qf "$target")
|
||||
[[ "$OWNER_NVR" == "$COMPILER_RT_NVR" ]] && continue
|
||||
|
||||
# The target exists but it's not owned by compiler-rt. It must be
|
||||
# owned by one of its dependencies, else flag a failure.
|
||||
if ! grep "$OWNER_NVR" "$tmp/dependencies.log"; then
|
||||
rlFail "$file pointing to $target is a dangling symlink owned by $OWNER_NVR"
|
||||
fi
|
||||
done
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "rm -rf $tmp" 0 "Removing temp dir"
|
||||
rlPhaseEnd
|
||||
rlJournalEnd
|
||||
|
|
@ -5,6 +5,3 @@ framework: shell
|
|||
component:
|
||||
- llvm-toolset
|
||||
- llvm
|
||||
extra-summary: /tools/llvm/build-compat
|
||||
extra-task: /tools/llvm/build-compat
|
||||
extra-nitrate: TC#0614093
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ dnf download --disablerepo=* --enablerepo=test-llvm --source llvm
|
|||
|
||||
# The src.rpm is available in the directory the test run from.
|
||||
set +e
|
||||
mock --resultdir=. --old-chroot --with compat_build --rebuild *.src.rpm
|
||||
if [ $? -ne 0 ]; then
|
||||
if ! mock --resultdir=. --old-chroot --with compat_build --rebuild ./*.src.rpm;
|
||||
then
|
||||
cat root.log
|
||||
cat build.log
|
||||
exit 1
|
||||
|
|
|
|||
8
tests/clang-format-diff/main.fmf
Normal file
8
tests/clang-format-diff/main.fmf
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
summary: clang-format-diff
|
||||
tier: 1
|
||||
|
||||
link+:
|
||||
verifies: https://bugzilla.redhat.com/show_bug.cgi?id=1939018
|
||||
|
||||
require+:
|
||||
- clang-tools-extra
|
||||
5
tests/clang-format-diff/test.sh
Executable file
5
tests/clang-format-diff/test.sh
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh -eux
|
||||
|
||||
# Check that clang-format-diff is in PATH.
|
||||
# rhbz#1939018
|
||||
clang-format-diff -h
|
||||
32
tests/cmake-imported-targets-llvm/CMakeLists.txt
Normal file
32
tests/cmake-imported-targets-llvm/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
cmake_minimum_required(VERSION 3.20.0)
|
||||
project(SimpleProject)
|
||||
|
||||
# Find LLVM package and save all the imported targets into a list.
|
||||
find_package(LLVM REQUIRED CONFIG)
|
||||
get_property(LLVMImportedTargets DIRECTORY "${CMAKE_SOURCE_DIR}" PROPERTY IMPORTED_TARGETS)
|
||||
|
||||
# Find Clang package and save all the imported targets into a list. As Clang's
|
||||
# find_package depends on LLVM - it calls find_package(LLVM) internally - this
|
||||
# implicitly import all the LLVM targets too, so we have to filter these out
|
||||
# with the previous list.
|
||||
find_package(Clang REQUIRED CONFIG)
|
||||
get_property(ClangImportedTargets DIRECTORY "${CMAKE_SOURCE_DIR}" PROPERTY IMPORTED_TARGETS)
|
||||
list(REMOVE_ITEM ClangImportedTargets ${LLVMImportedTargets})
|
||||
|
||||
# Filter out targets imported from internal find_package such as FFI, LibEdit, ZLIB, etc
|
||||
# These might or might not be installed in the user's system. These are prefixed
|
||||
# with "<MODULE>::" (e.g. LibEdit::LibEdit).
|
||||
list(FILTER LLVMImportedTargets EXCLUDE REGEX "::")
|
||||
|
||||
# For all imported targets by LLVM get the location of the object and dump It
|
||||
# to an output.txt file. The test script will parse it later.
|
||||
foreach(target IN LISTS LLVMImportedTargets)
|
||||
get_target_property(tgt_loc ${target} LOCATION)
|
||||
file(APPEND ${CMAKE_BINARY_DIR}/llvm_targets.txt "${tgt_loc}\n")
|
||||
endforeach()
|
||||
|
||||
# Do the same operation with Clang imported targets
|
||||
foreach(target IN LISTS ClangImportedTargets)
|
||||
get_target_property(tgt_loc ${target} LOCATION)
|
||||
file(APPEND ${CMAKE_BINARY_DIR}/clang_targets.txt "${tgt_loc}\n")
|
||||
endforeach()
|
||||
12
tests/cmake-imported-targets-llvm/main.fmf
Normal file
12
tests/cmake-imported-targets-llvm/main.fmf
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
summary: Test LLVM and Clang's find_package imported targets
|
||||
description: |
|
||||
This test ensures that all the exported targets provided by LLVM and Clang's
|
||||
find_package are really present in the system, and are provided by a either
|
||||
llvm/clang-devel package or a package is directly dependent on them.
|
||||
framework: beakerlib
|
||||
tier: 1
|
||||
require+:
|
||||
- cmake
|
||||
- llvm-devel
|
||||
- clang-devel
|
||||
- which
|
||||
68
tests/cmake-imported-targets-llvm/test.sh
Executable file
68
tests/cmake-imported-targets-llvm/test.sh
Executable file
|
|
@ -0,0 +1,68 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlRun "set -o pipefail"
|
||||
declare LLVM_DEVEL CLANG_DEVEL src_dir tmp_dir
|
||||
# Guess the name of the -devel packages. This is needed to make the test
|
||||
# agnostic to versioned/unversioned packages. This should work equally
|
||||
# for llvm19-devel or llvm-devel.
|
||||
rlRun "LLVM_DEVEL=$(rpm -qf --qf '%{name}-devel' "$(which llc)")"
|
||||
rlRun "CLANG_DEVEL=$(rpm -qf --qf '%{name}-devel' "$(which clang)")"
|
||||
rlRun "tmp_dir=$(mktemp -d -p /var/tmp)"
|
||||
rlRun "src_dir=$(pwd)"
|
||||
|
||||
# Gather rpms required *explicitly* by the currently installed
|
||||
# llvm-devel and clang-devel. We'll consider each package dependent on
|
||||
# itself.
|
||||
for pkg in $LLVM_DEVEL $CLANG_DEVEL; do
|
||||
dependencies=$(rpm -q --requires "$pkg" | cut -d ' ' -f 1 )
|
||||
{
|
||||
for req in $dependencies; do
|
||||
rpm -q --whatprovides "$req"
|
||||
done
|
||||
} | sort -u > "${tmp_dir}/${pkg}-dependencies.txt"
|
||||
rpm -q "$pkg" >> "${tmp_dir}/${pkg}-dependencies.txt"
|
||||
done
|
||||
|
||||
rlRun "pushd $tmp_dir"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
# The CMakeLists.txt will produce two text files named llvm_targets.txt
|
||||
# and clang_targets.txt, which contains the locations of all the
|
||||
# libraries and executables exported (imported from user's persective)
|
||||
# as targets.
|
||||
rlRun "cmake $src_dir"
|
||||
|
||||
# llvm-devel must be a dependency of clang-devel, as ClangConfig.cmake
|
||||
# depends on LLVMConfig.cmake.
|
||||
rlAssertGrep "$LLVM_DEVEL" "${tmp_dir}/${CLANG_DEVEL}-dependencies.txt"
|
||||
|
||||
# For each imported target file, check who provides it and if the provider
|
||||
# is in the dependency list (or is the package itself).
|
||||
# Do not use rlAssertGrep, it will report hundreds of PASS lines making
|
||||
# the log unnecessarily big.
|
||||
rlLog "Parsing LLVM imported targets"
|
||||
while IFS= read -r importedFile; do
|
||||
if ! grep -q "$(rpm -qf "${importedFile}")" "${tmp_dir}/${LLVM_DEVEL}-dependencies.txt"; then
|
||||
rlFail "${importedFile} is imported as a CMake target by ${LLVM_DEVEL}, but it's not part of any of its required packages."
|
||||
fi
|
||||
done < llvm_targets.txt
|
||||
rlLog "Parsing Clang imported targets"
|
||||
while IFS= read -r importedFile; do
|
||||
if ! grep -q "$(rpm -qf "${importedFile}")" "${tmp_dir}/${CLANG_DEVEL}-dependencies.txt"; then
|
||||
rlFail "${importedFile} is imported as a CMake target by ${CLANG_DEVEL}, but it's not part of any of its required packages."
|
||||
fi
|
||||
done < clang_targets.txt
|
||||
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -rf $tmp_dir" 0 "Remove temporary directory: $tmp_dir"
|
||||
rlPhaseEnd
|
||||
rlJournalEnd
|
||||
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
declare tmp
|
||||
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
|
||||
rlRun "cp reproducer.c $tmp"
|
||||
rlRun "pushd $tmp"
|
||||
|
|
|
|||
30
tests/cross-compile-i686/main.fmf
Normal file
30
tests/cross-compile-i686/main.fmf
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
summary: compiler-rt test for rhbz#1678240
|
||||
description: >
|
||||
Test that clang -m32 -fsanitize looks for compiler-rt library in the
|
||||
proper directory
|
||||
tier: 1
|
||||
|
||||
tag+:
|
||||
- multilib
|
||||
- fedora-only
|
||||
|
||||
require+:
|
||||
- compiler-rt.i686
|
||||
- glibc-devel.i686
|
||||
adjust+:
|
||||
# Common requirements when LLVM is not SCL-ized
|
||||
- enabled: false
|
||||
because: "Test applicable only on x86_64 arch"
|
||||
when: arch != x86_64
|
||||
|
||||
- enabled: false
|
||||
because: "compiler-rt.i686 packages not shipped in RHEL/CentOS"
|
||||
when: distro == rhel or distro == centos
|
||||
|
||||
- enabled: false
|
||||
because: "compiler-rt.i686 may not be available in snapshot builds when x86_64 tests are executed"
|
||||
when: snapshot is defined
|
||||
|
||||
- enabled: false
|
||||
because: "compat packages are not configured for multilib"
|
||||
when: compat is defined
|
||||
1
tests/cross-compile-i686/test.c
Normal file
1
tests/cross-compile-i686/test.c
Normal file
|
|
@ -0,0 +1 @@
|
|||
int main(){return 0;}
|
||||
3
tests/cross-compile-i686/test.sh
Executable file
3
tests/cross-compile-i686/test.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh -eux
|
||||
|
||||
clang -m32 -fsanitize=address test.c
|
||||
5
tests/fedora-flags/hello.c
Normal file
5
tests/fedora-flags/hello.c
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#include <stdio.h>
|
||||
|
||||
void hello() {
|
||||
printf("Hello World\n");
|
||||
}
|
||||
5
tests/fedora-flags/hello.cpp
Normal file
5
tests/fedora-flags/hello.cpp
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#include <iostream>
|
||||
|
||||
void hello() {
|
||||
std::cout << "Hello World\n";
|
||||
}
|
||||
6
tests/fedora-flags/main.c
Normal file
6
tests/fedora-flags/main.c
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
void hello();
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
hello();
|
||||
return 0;
|
||||
}
|
||||
6
tests/fedora-flags/main.cpp
Normal file
6
tests/fedora-flags/main.cpp
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
void hello();
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
hello();
|
||||
return 0;
|
||||
}
|
||||
5
tests/fedora-flags/main.fmf
Normal file
5
tests/fedora-flags/main.fmf
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
summary: fedora-flags
|
||||
description: Build sample C/C++ code with default system flags from redhat-rpm-config
|
||||
require+:
|
||||
- redhat-rpm-config
|
||||
tier: 1
|
||||
21
tests/fedora-flags/test.sh
Executable file
21
tests/fedora-flags/test.sh
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
# shellcheck disable=SC2086
|
||||
|
||||
set -ex pipefail
|
||||
|
||||
cflags=$(rpm -D '%toolchain clang' -E '%{build_cflags}')
|
||||
cxxflags=$(rpm -D '%toolchain clang' -E '%{build_cxxflags}')
|
||||
ldflags=$(rpm -D '%toolchain clang' -E '%{build_ldflags}')
|
||||
|
||||
|
||||
# Test a c program
|
||||
clang $cflags -c hello.c -o hello.o
|
||||
clang $cflags -c main.c -o main.o
|
||||
clang $ldflags -o hello main.o hello.o
|
||||
./hello | grep "Hello World"
|
||||
|
||||
# Test a cxx program
|
||||
clang++ $cxxflags -c hello.cpp -o hello-cpp.o
|
||||
clang++ $cxxflags -c main.cpp -o main-cpp.o
|
||||
clang++ $ldflags -o hello-cpp main-cpp.o hello-cpp.o
|
||||
./hello-cpp | grep "Hello World"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
summary: Find LLVM package with CMake
|
||||
summary: Find LLVM package with CMake.
|
||||
description: |
|
||||
Find LLVM package with CMake. This is to guarantee that building the packages
|
||||
together (aka "big-merge") but only installing them partially (e.g. llvm
|
||||
|
|
@ -20,6 +20,8 @@ require+:
|
|||
- llvm-devel
|
||||
- clang
|
||||
- clang-devel
|
||||
|
||||
adjust+:
|
||||
- enabled: false
|
||||
when: collection is defined
|
||||
when: deploymentmode == image
|
||||
because: "/usr is readonly in imagemode systems"
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlRun "set -o pipefail"
|
||||
declare loc_old loc_new tmp_dir
|
||||
rlRun "loc_old=$(which clang-tblgen)"
|
||||
rlRun "loc_new=$(mktemp)"
|
||||
rlRun "tmp_dir=$(mktemp -d -p /var/tmp)"
|
||||
|
|
|
|||
3
tests/flang/hello.f
Normal file
3
tests/flang/hello.f
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
PROGRAM HELLO
|
||||
PRINT '(A)', 'Hello, world'
|
||||
END
|
||||
25
tests/flang/main.fmf
Normal file
25
tests/flang/main.fmf
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
summary: Run simple tests for flang
|
||||
|
||||
tag+:
|
||||
- fedora-only
|
||||
|
||||
adjust+:
|
||||
- because: "flang is available for Fedora, not RHEL/CentOS"
|
||||
when: >-
|
||||
distro == rhel
|
||||
or distro == centos
|
||||
enabled: false
|
||||
|
||||
- because: "flang is only part of llvm since Fedora 44"
|
||||
when: snapshot is defined and distro < fedora-44
|
||||
enabled: false
|
||||
|
||||
- because: "flang is not built for compat packages"
|
||||
enabled: false
|
||||
when: compat is defined
|
||||
|
||||
require+:
|
||||
- flang
|
||||
- llvm-devel
|
||||
- libgcc
|
||||
duration: 1h
|
||||
5
tests/flang/sin.f90
Normal file
5
tests/flang/sin.f90
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
program sin
|
||||
real :: pi
|
||||
pi = 4*atan(1.0)
|
||||
print *, sin(pi/2)
|
||||
end program
|
||||
13
tests/flang/test.sh
Executable file
13
tests/flang/test.sh
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/bash
|
||||
# Compile and run simple Fortran programs in order to evaluate if Flang is
|
||||
# minimally funcional.
|
||||
|
||||
set -e
|
||||
|
||||
flang hello.f -o hello
|
||||
./hello | grep -q "Hello, world"
|
||||
rm hello
|
||||
|
||||
flang sin.f90 -o sin
|
||||
./sin | grep -q "1."
|
||||
rm sin
|
||||
7
tests/fp16-abi/main.fmf
Normal file
7
tests/fp16-abi/main.fmf
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
summary: Test that Float16 ABI matches with clang
|
||||
tier: 1
|
||||
|
||||
adjust+:
|
||||
- because: "Float16 not supported on s390x or ppc64le"
|
||||
enabled: false
|
||||
when: arch == s390x or arch == ppc64le
|
||||
14
tests/fp16-abi/test.cpp
Normal file
14
tests/fp16-abi/test.cpp
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// Reproducer based on this code from Steve Leung (evetsso):
|
||||
// https://github.com/ROCmSoftwarePlatform/rocFFT/issues/439#issuecomment-1693835987
|
||||
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
int main()
|
||||
{
|
||||
_Float16 one_f16 = 0.123;
|
||||
float one_f32 = one_f16;
|
||||
std::cout << one_f32 << std::endl;
|
||||
return 0;
|
||||
}
|
||||
15
tests/fp16-abi/test.sh
Executable file
15
tests/fp16-abi/test.sh
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash -ux
|
||||
# Do NOT set exit after error flag (set -e). Let all the optimizations to be run
|
||||
|
||||
tmp=$(mktemp -d)
|
||||
result=0
|
||||
# Test the reproducer with all the optimization levels
|
||||
for opt_level in 0 1 2 3; do
|
||||
clang++ --rtlib=compiler-rt -O$opt_level test.cpp -o "${tmp}/test_O${opt_level}"
|
||||
"${tmp}/test_O${opt_level}" | grep '0.122986' || result=1
|
||||
done
|
||||
|
||||
rm -rf "$tmp"
|
||||
if [[ "$result" == 1 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
6
tests/gcc-clang-compatibility/hello.cpp
Normal file
6
tests/gcc-clang-compatibility/hello.cpp
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#include <iostream>
|
||||
|
||||
int main(){
|
||||
std::cout << "Hello world!\n";
|
||||
return 0;
|
||||
}
|
||||
8
tests/gcc-clang-compatibility/main.fmf
Normal file
8
tests/gcc-clang-compatibility/main.fmf
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
summary: Test that both gcc/clang compile/link compatibility.
|
||||
description:
|
||||
Build an object file with g++, link it with clang++ and viceversa, to ensure
|
||||
that objects compiled with one can be linked with the other.
|
||||
tier: 1
|
||||
|
||||
require+:
|
||||
- gcc-c++
|
||||
33
tests/gcc-clang-compatibility/test.sh
Executable file
33
tests/gcc-clang-compatibility/test.sh
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash -eux
|
||||
|
||||
tmp=$(mktemp -d)
|
||||
|
||||
# clang not necessarily depends on system gcc. It might depend on gcc from
|
||||
# gcc-toolset-XX, in such case we need to test the compatibility with that one.
|
||||
# We can get that from `clang -v` output.
|
||||
TOOLSET=$(clang -v |& grep "Selected GCC installation" | grep -P -o '(dev|gcc-)toolset-[0-9]*') ||:
|
||||
if [[ "" = "${TOOLSET}" ]]; then
|
||||
GCC="g++"
|
||||
else
|
||||
# GTS 15 started to shift away from scl in favor of the
|
||||
# gcc-toolset-xx-env command.
|
||||
if command -v "${TOOLSET}-env" &>/dev/null; then
|
||||
GCC="${TOOLSET}-env -- g++"
|
||||
echo "Testing with g++ from ${TOOLSET} using ${TOOLSET}-env"
|
||||
else
|
||||
GCC="scl enable ${TOOLSET} -- g++"
|
||||
echo "Testing with g++ from ${TOOLSET}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Build the source with GCC, link it with clang
|
||||
${GCC} -c hello.cpp -o "${tmp}/hello.o"
|
||||
clang++ -o "${tmp}"/hello "${tmp}/hello.o"
|
||||
"${tmp}/hello" | grep "Hello world"
|
||||
rm -rf "${tmp:?}"/*
|
||||
|
||||
# Build the source with clang, link it with GCC
|
||||
clang++ -c hello.cpp -o "${tmp}/hello.o"
|
||||
${GCC} -o "${tmp}"/hello "${tmp}/hello.o"
|
||||
"${tmp}/hello" | grep "Hello world"
|
||||
rm -rf "${tmp:?}"/*
|
||||
|
|
@ -17,6 +17,7 @@ environment+:
|
|||
NO_LIBCXX: true
|
||||
NO_STATIC_LIBCXX: true
|
||||
NO_LIBUNWIND: true
|
||||
LIBOMP: true
|
||||
|
||||
adjust+:
|
||||
- enabled: false
|
||||
|
|
|
|||
|
|
@ -1,70 +0,0 @@
|
|||
# DevTools collections settings.
|
||||
|
||||
environment+:
|
||||
NO_LIBCXX: true
|
||||
NO_STATIC_LIBCXX: true
|
||||
NO_LIBUNWIND: true
|
||||
|
||||
adjust+:
|
||||
- enabled: false
|
||||
when: collection is not defined
|
||||
continue: false
|
||||
|
||||
# Requirements for SCL-ized LLVM
|
||||
- require+:
|
||||
- llvm-toolset-13.0-cmake
|
||||
- llvm-toolset-13.0-clang
|
||||
- llvm-toolset-13.0-clang-analyzer
|
||||
- llvm-toolset-13.0-clang-devel
|
||||
- llvm-toolset-13.0-clang-tools-extra
|
||||
- llvm-toolset-13.0-compiler-rt
|
||||
- llvm-toolset-13.0-lld
|
||||
- llvm-toolset-13.0-lldb
|
||||
- llvm-toolset-13.0-libomp-devel
|
||||
- llvm-toolset-13.0-llvm-devel
|
||||
- llvm-toolset-13.0-python3-lit
|
||||
when: "collection == llvm-toolset-13.0"
|
||||
- require+:
|
||||
- llvm-toolset-14.0-cmake
|
||||
- llvm-toolset-14.0-clang
|
||||
- llvm-toolset-14.0-clang-analyzer
|
||||
- llvm-toolset-14.0-clang-devel
|
||||
- llvm-toolset-14.0-clang-tools-extra
|
||||
- llvm-toolset-14.0-compiler-rt
|
||||
- llvm-toolset-14.0-lld
|
||||
- llvm-toolset-14.0-lldb
|
||||
- llvm-toolset-14.0-libomp-devel
|
||||
- llvm-toolset-14.0-llvm-devel
|
||||
- llvm-toolset-14.0-python3-lit
|
||||
when: "collection == llvm-toolset-14.0"
|
||||
- require+:
|
||||
- llvm-toolset-15.0-cmake
|
||||
- llvm-toolset-15.0-clang
|
||||
- llvm-toolset-15.0-clang-analyzer
|
||||
- llvm-toolset-15.0-clang-devel
|
||||
- llvm-toolset-15.0-clang-tools-extra
|
||||
- llvm-toolset-15.0-compiler-rt
|
||||
- llvm-toolset-15.0-lld
|
||||
- llvm-toolset-15.0-lldb
|
||||
- llvm-toolset-15.0-libomp-devel
|
||||
- llvm-toolset-15.0-llvm-devel
|
||||
- llvm-toolset-15.0-python3-lit
|
||||
when: "collection == llvm-toolset-15.0"
|
||||
|
||||
# lld not supported in s390x or ppc64. If any lld package was added to
|
||||
# requirements, remove it.
|
||||
- require-:
|
||||
- llvm-toolset-13.0-lld
|
||||
- llvm-toolset-14.0-lld
|
||||
- llvm-toolset-15.0-lld
|
||||
when: >-
|
||||
collection is defined and arch == s390x
|
||||
or arch == ppc64
|
||||
|
||||
# libomp not supported in s390x. If any libomp-devel package was added to
|
||||
# requirements, remove it.
|
||||
- require-:
|
||||
- llvm-toolset-13.0-libomp-devel
|
||||
- llvm-toolset-14.0-libomp-devel
|
||||
- llvm-toolset-15.0-libomp-devel
|
||||
when: collection is defined and arch == s390x
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
# Fedora system repos package testing.
|
||||
# This setup is meant to be used with packages in system repos, not with
|
||||
# compat packages, or snapshots.
|
||||
# Fedora package testing.
|
||||
# This setup is meant to be used with non-compat packages.
|
||||
|
||||
require+:
|
||||
- cmake
|
||||
|
|
@ -21,19 +20,5 @@ require+:
|
|||
|
||||
adjust+:
|
||||
- enabled: false
|
||||
when: distro != fedora or snapshot is defined or compat is defined
|
||||
when: distro != fedora or compat is defined
|
||||
continue: false
|
||||
|
||||
# libomp and lld are supported in s390x for LLVM >= 18. Until tmt provides
|
||||
# a way to provide custom contexts, we need to filter out by distro versions.
|
||||
- require-:
|
||||
- lld
|
||||
- libomp-devel
|
||||
when: arch == s390x and distro < fedora-40
|
||||
|
||||
# libunwind is not built for s390x in LLVM < 17
|
||||
- require-:
|
||||
- llvm-libunwind-devel
|
||||
environment+:
|
||||
NO_LIBUNWIND: true
|
||||
when: arch == s390x and distro < fedora-39
|
||||
|
|
|
|||
|
|
@ -11,8 +11,6 @@ component+:
|
|||
- compiler-rt
|
||||
- python3-lit
|
||||
- libomp
|
||||
extra-summary: /tools/llvm/integration-test-suite
|
||||
extra-task: /tools/llvm/integration-test-suite
|
||||
|
||||
require+:
|
||||
- git
|
||||
|
|
@ -31,5 +29,3 @@ recommend+:
|
|||
# was part of binutils (e.g RHEL 8), or in distros where gold is deprecated
|
||||
# (e.g. future Fedoras)
|
||||
- binutils-gold
|
||||
|
||||
extra-nitrate: TC#0614094
|
||||
|
|
|
|||
|
|
@ -20,19 +20,31 @@ environment+:
|
|||
|
||||
adjust+:
|
||||
- enabled: false
|
||||
when: distro != rhel and distro != centos or collection is defined
|
||||
when: distro != rhel and distro != centos
|
||||
continue: false
|
||||
|
||||
# lld is supported in s390x for LLVM >= 18. Until tmt provides
|
||||
# a way to provide custom contexts, we need to filter out by distro versions.
|
||||
- require-:
|
||||
- lld
|
||||
when: arch == s390x and distro < rhel-8.10, centos-stream-9
|
||||
when: arch == s390x and distro < rhel-8.10
|
||||
- require-:
|
||||
- lld
|
||||
when: arch == s390x and distro == rhel-9 and distro < rhel-9.5
|
||||
when: arch == s390x and distro ~< rhel-9.5
|
||||
|
||||
# libomp is not supported in s390x in RHEL.
|
||||
# libomp is not supported in s390x in RHEL... Until LLVM 19
|
||||
- require-:
|
||||
- libomp-devel
|
||||
when: arch == s390x
|
||||
when: arch == s390x and distro ~< rhel-9.6.0
|
||||
|
||||
# RHEL 8 use python3.12
|
||||
- require-:
|
||||
- python3-lit
|
||||
when: distro == rhel-8
|
||||
- require+:
|
||||
- python3.12-lit
|
||||
when: distro == rhel-8
|
||||
|
||||
- environment+:
|
||||
NO_GOLD: true
|
||||
when: distro >= rhel-11
|
||||
|
|
|
|||
|
|
@ -1,28 +0,0 @@
|
|||
# llvm-snapshots specific setup.
|
||||
# These are daily builds (latest upstream sources) of a reduced set of the llvm
|
||||
# components in currently supported Fedora releases.
|
||||
# Supported components can be checked in:
|
||||
# https://copr.fedorainfracloud.org/coprs/g/fedora-llvm-team/llvm-snapshots/monitor/
|
||||
|
||||
require+:
|
||||
- cmake
|
||||
- clang
|
||||
- clang-analyzer
|
||||
- clang-devel
|
||||
- clang-tools-extra
|
||||
- compiler-rt
|
||||
- lld
|
||||
- lldb
|
||||
- libomp-devel
|
||||
- llvm-devel
|
||||
- python3-lit
|
||||
|
||||
environment+:
|
||||
NO_LIBCXX: true
|
||||
NO_STATIC_LIBCXX: true
|
||||
NO_LIBUNWIND: true
|
||||
|
||||
adjust+:
|
||||
- enabled: false
|
||||
when: snapshot is not defined
|
||||
continue: false
|
||||
|
|
@ -21,7 +21,7 @@ function logTmtRequiredPackages(){
|
|||
rlLog "# Installed packages:"
|
||||
rlLog "#----------------------------#"
|
||||
for pkg in $TMT_REQUIRES; do
|
||||
rlAssertRpm $pkg
|
||||
rlAssertRpm "$pkg"
|
||||
done;
|
||||
rlLog "#----------------------------#"
|
||||
|
||||
|
|
@ -31,6 +31,7 @@ rlJournalStart
|
|||
rlPhaseStartSetup
|
||||
logTmtRequiredPackages
|
||||
|
||||
declare TmpDir
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "pushd $TmpDir"
|
||||
rlPhaseEnd
|
||||
|
|
@ -42,6 +43,7 @@ rlJournalStart
|
|||
rlRun "mkdir _build && cd _build"
|
||||
|
||||
CONFIG_CMD="cmake .."
|
||||
CONFIG_CMD+="${NO_GOLD:+ -DENABLE_GOLD_TESTS=OFF}"
|
||||
CONFIG_CMD+="${NO_LIBCXX:+ -DENABLE_LIBCXX=OFF}"
|
||||
CONFIG_CMD+="${NO_STATIC_LIBCXX:+ -DENABLE_STATIC_LIBCXX=OFF}"
|
||||
CONFIG_CMD+="${NO_LIBUNWIND:+ -DENABLE_LIBUNWIND=OFF}"
|
||||
|
|
|
|||
56
tests/kernel-ark-build/main.fmf
Normal file
56
tests/kernel-ark-build/main.fmf
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
summary: Build kernel-ark with clang
|
||||
framework: beakerlib
|
||||
component+:
|
||||
- llvm
|
||||
- lld
|
||||
# CKI pipelines times out after 5h. 4h is safe for us.
|
||||
duration: 4h
|
||||
tier: 1
|
||||
require+:
|
||||
- llvm-devel
|
||||
- lld
|
||||
- git
|
||||
- make
|
||||
- gcc
|
||||
- flex
|
||||
- bison
|
||||
- bzip2
|
||||
- rpm-build
|
||||
- dnf-plugins-core
|
||||
adjust+:
|
||||
- when: distro is not defined or distro != fedora-rawhide
|
||||
enabled: false
|
||||
because: Only meaninful in Rawhide
|
||||
link+:
|
||||
- verifies: https://issues.redhat.com/browse/LLVM-72
|
||||
tag+:
|
||||
- not-in-default
|
||||
- fedora-only
|
||||
|
||||
/base:
|
||||
summary+: " (base/non-LTO)"
|
||||
|
||||
/debug:
|
||||
summary+: " (debug/non-LTO)"
|
||||
environment+:
|
||||
ENABLE_DEBUG: 1
|
||||
adjust+:
|
||||
- enabled: false
|
||||
when: arch != x86_64 and arch != aarch64
|
||||
|
||||
/base-lto:
|
||||
summary+: " (base/LTO)"
|
||||
environment+:
|
||||
ENABLE_LTO: 1
|
||||
adjust+:
|
||||
- enabled: false
|
||||
when: arch != x86_64 and arch != aarch64
|
||||
|
||||
/debug-lto:
|
||||
summary+: " (debug/LTO)"
|
||||
environment+:
|
||||
ENABLE_LTO: 1
|
||||
ENABLE_DEBUG: 1
|
||||
adjust+:
|
||||
- enabled: false
|
||||
when: arch != x86_64 and arch != aarch64
|
||||
194
tests/kernel-ark-build/test.sh
Executable file
194
tests/kernel-ark-build/test.sh
Executable file
|
|
@ -0,0 +1,194 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
## General configuration variables. Can be overridden via environment
|
||||
# Kernel branch to build. Typically ark-latest or os-build.
|
||||
KERNEL_BRANCH=${KERNEL_BRANCH:-"ark-latest"}
|
||||
KERNEL_GIT_URL=${KERNEL_GIT_URL:-"https://gitlab.com/cki-project/kernel-ark.git"}
|
||||
|
||||
## Helper variables to handle cached/generated SRPM
|
||||
CACHE_DIR_BASE="/var/tmp/kernel-"
|
||||
KERNEL_SRPM_PATTERN="kernel-*.src.rpm"
|
||||
# Path to the kernel SRPM to build.
|
||||
KERNEL_SRPM=""
|
||||
|
||||
# Environment variables to configure the kernel build:
|
||||
# * ENABLE_LTO: If set, it will build kernel-ark with clang_lto.
|
||||
# * ENABLE_DEBUG: If set, it will build kernel-ark in debug mode.
|
||||
CLANG_MODE=${ENABLE_LTO:+"--with clang_lto"}
|
||||
CLANG_MODE=${CLANG_MODE:-"--with clang"}
|
||||
# Build mode, base or debug
|
||||
BUILD_MODE=${ENABLE_DEBUG:+"--with debug --without base"}
|
||||
BUILD_MODE=${BUILD_MODE:-"--with base --without debug"}
|
||||
|
||||
# Log installed packages required by TMT
|
||||
logTmtRequiredPackages() {
|
||||
if [[ ! -e $TMT_TEST_METADATA ]]; then
|
||||
rlLogWarning "${FUNCNAME[0]}: No TMT_TEST_METADATA file found. Run the test from tmt"
|
||||
return
|
||||
fi
|
||||
TMT_REQUIRES=$(rlGetYAMLdeps)
|
||||
rlLog "# Installed packages:"
|
||||
rlLog "#----------------------------#"
|
||||
for pkg in $TMT_REQUIRES; do
|
||||
rlAssertRpm "$pkg"
|
||||
done
|
||||
rlLog "#----------------------------#"
|
||||
}
|
||||
|
||||
# Check if a previous test run created a kernel SRPM for the latest commit
|
||||
# If found, the abspath is stored in KERNEL_SRPM global variable
|
||||
# Returns 0 if srpm found, 1 otherwise.
|
||||
checkCache() {
|
||||
local commit_hash
|
||||
local cache_dir
|
||||
local cached_srpm
|
||||
|
||||
commit_hash=$(git ls-remote "${KERNEL_GIT_URL}" "${KERNEL_BRANCH}" | awk '{print $1}')
|
||||
rlLog "Latest commit for ${KERNEL_BRANCH} branch: $commit_hash"
|
||||
|
||||
cache_dir="${CACHE_DIR_BASE}${commit_hash}/"
|
||||
if [[ -d "$cache_dir" ]]; then
|
||||
cached_srpm=$(find "$cache_dir" -name "${KERNEL_SRPM_PATTERN}")
|
||||
if [[ -n "$cached_srpm" ]]; then
|
||||
rlLog "Found cached SRPM: $cached_srpm"
|
||||
rlRun "dnf builddep -y $cached_srpm > install-buildreqs.log 2>&1"
|
||||
rlFileSubmit install-buildreqs.log
|
||||
KERNEL_SRPM="$cached_srpm"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
rlLog "Cached kernel SRPM not found"
|
||||
return 1
|
||||
}
|
||||
|
||||
# Attempts to clone the kernel-ark tree in the CWD, at most 3 times.
|
||||
# Returns 0 on success, 1 otherwise
|
||||
cloneKernelTree() {
|
||||
local retries=3
|
||||
local delay=10
|
||||
|
||||
rlLog "Cloning kernel"
|
||||
while [[ $retries -gt 0 ]]; do
|
||||
rlRun "git clone -q --branch ${KERNEL_BRANCH} ${KERNEL_GIT_URL}" 0-255
|
||||
retcode=$?
|
||||
if [[ $retcode -eq 0 ]]; then
|
||||
return 0
|
||||
else
|
||||
retries=$((retries - 1))
|
||||
rlLog "Clone failed, wait ${delay}s and retry ($retries retries left)"
|
||||
sleep $delay
|
||||
fi
|
||||
done
|
||||
return "$retcode"
|
||||
}
|
||||
|
||||
# In a kernel-ark repository, do all the operations needed to generate an SRPM
|
||||
# If the kernel is generated return the abspath in KERNEL_SRPM global variable
|
||||
# Returns 0 on success, 1 otherwise
|
||||
generateSRPM() {
|
||||
local generated_srpm
|
||||
local commit_hash
|
||||
local cache_dir
|
||||
|
||||
if ! cloneKernelTree; then
|
||||
rlFail "Failed to clone kernel tree"
|
||||
return 1
|
||||
fi
|
||||
|
||||
rlRun "pushd kernel-ark"
|
||||
rlLog "Gathering and installing missing build requirements"
|
||||
rlRun "make dist-get-buildreqs > make-buildreqs.log 2>&1"
|
||||
rlFileSubmit make-buildreqs.log
|
||||
if grep -q 'Missing dependencies:' make-buildreqs.log; then
|
||||
# Getting the build requirements is quite tricky as it might contain
|
||||
# not only package names but also "provides" perl(ExtUtils::Embed) which
|
||||
# can break the dnf command if not escaped properly. The safest way is
|
||||
# to create an array which contains each req as argument, then pass the
|
||||
# array to dnf. Bash will later pass each element properly quoted.
|
||||
# rlRun can also easily break the command due to special characters
|
||||
# so we don't use it here.
|
||||
read -ra KERNEL_BUILDREQS <<< "$(sed -n 's/Missing dependencies://p' make-buildreqs.log)"
|
||||
rlLog "Installing dependencies: ${KERNEL_BUILDREQS[*]}"
|
||||
dnf install --setopt=install_weak_deps=False -y "${KERNEL_BUILDREQS[@]}" > install-buildreqs.log 2>&1 || \
|
||||
rlFail "$(cat install-buildreqs.log)"
|
||||
rlFileSubmit install-buildreqs.log
|
||||
elif grep 'PASS:' make-buildreqs.log; then
|
||||
rlLog "All dependencies were already installed"
|
||||
else
|
||||
rlLogWarning "Error getting dependencies, the build might fail"
|
||||
rlRun "cat make-buildreqs.log"
|
||||
fi
|
||||
|
||||
rlLog "Generating SRPM"
|
||||
rlRun "make dist-srpm > dist-srpm.log 2>&1"
|
||||
rlFileSubmit dist-srpm.log
|
||||
|
||||
generated_srpm=$(find "$(pwd)" -name "$KERNEL_SRPM_PATTERN")
|
||||
if [[ -e "$generated_srpm" ]]; then
|
||||
rlLog "Caching generated SRPM"
|
||||
commit_hash=$(git rev-parse HEAD)
|
||||
cache_dir="${CACHE_DIR_BASE}${commit_hash}/"
|
||||
rlRun "mkdir -p $cache_dir"
|
||||
rlRun "cp $generated_srpm $cache_dir"
|
||||
KERNEL_SRPM="$generated_srpm"
|
||||
rlRun "popd"
|
||||
return 0
|
||||
else
|
||||
rlLogWarning "Failed to generate SRPM"
|
||||
rlRun "popd"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlRun "nproc"
|
||||
rlRun "free -h"
|
||||
logTmtRequiredPackages
|
||||
|
||||
declare tmp
|
||||
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
|
||||
rlRun "pushd $tmp"
|
||||
rlRun "set -o pipefail"
|
||||
if rlIsFedora; then
|
||||
rlLog "Disable updates-testing"
|
||||
if command -v dnf5; then
|
||||
rlRun "dnf5 config-manager setopt updates-testing.enabled=0"
|
||||
else
|
||||
rlRun "dnf-3 config-manager --set-disabled updates-testing"
|
||||
fi
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
# Check if kernel package was generated by a previous test run
|
||||
# and generate a new one if it wasn't
|
||||
checkCache
|
||||
if [[ -e "$KERNEL_SRPM" ]]; then
|
||||
rlLog "Using cached kernel SRPM: $KERNEL_SRPM"
|
||||
else
|
||||
rlLog "No kernel SRPM found, generating new SRPM"
|
||||
generateSRPM
|
||||
fi
|
||||
|
||||
if [[ -e "$KERNEL_SRPM" ]]; then
|
||||
BUILD_FLAGS="--target $(uname -m) --with up --with toolchain_clang "
|
||||
BUILD_FLAGS+="--without trace --without arm64_16k --without arm64_64k "
|
||||
BUILD_FLAGS+="--without realtime --without zfcpdump "
|
||||
BUILD_FLAGS+="${CLANG_MODE} ${BUILD_MODE}"
|
||||
|
||||
rlLog "Building kernel (branch $KERNEL_BRANCH)"
|
||||
rlRun "rpmbuild ${BUILD_FLAGS} --rebuild ${KERNEL_SRPM} > build.log 2>&1"
|
||||
rlFileSubmit build.log
|
||||
else
|
||||
rlFail "Kernel SRPM not found, finishing test"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $tmp" 0 "Remove tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalEnd
|
||||
|
|
@ -1,25 +1,6 @@
|
|||
summary: Check that libLLVM.so has been properly stripped
|
||||
tier: 1
|
||||
duration: 1m
|
||||
extra-summary: /tools/llvm/libllvm-size
|
||||
extra-task: /tools/llvm/libllvm-size
|
||||
|
||||
environment:
|
||||
LIBLLVM_PATH: /usr/lib64/libLLVM.so
|
||||
adjust+:
|
||||
|
||||
- because: "With SCL-ized LLVM, library path is different"
|
||||
environment+:
|
||||
LIBLLVM_PATH: /opt/rh/llvm-toolset-13.0/root/usr/lib64/libLLVM.so
|
||||
when: "collection == llvm-toolset-13.0"
|
||||
|
||||
- because: "With SCL-ized LLVM, library path is different"
|
||||
environment+:
|
||||
LIBLLVM_PATH: /opt/rh/llvm-toolset-14.0/root/usr/lib64/libLLVM.so
|
||||
when: "collection == llvm-toolset-14.0"
|
||||
|
||||
- because: "With SCL-ized LLVM, library path is different"
|
||||
environment+:
|
||||
LIBLLVM_PATH: /opt/rh/llvm-toolset-15.0/root/usr/lib64/libLLVM.so
|
||||
when: "collection == llvm-toolset-15.0"
|
||||
extra-nitrate: TC#0614095
|
||||
require+:
|
||||
- llvm-devel
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
#!/bin/sh -eux
|
||||
#!/bin/bash -eux
|
||||
|
||||
# Retrieve libLLVM path if not set via environment variable. This is necessary
|
||||
# to make the test flexible enough to use it with both compat and unversioned
|
||||
# packages.
|
||||
LIBLLVM_PATH=${LIBLLVM_PATH:-"$(llvm-config --libfiles)"}
|
||||
|
||||
# There is a bug in the build process when it runs out of disk space
|
||||
# while stripping binaries, which causes the strip to fail, but does
|
||||
|
|
@ -7,4 +12,7 @@
|
|||
# is less than 500MB to ensure it was successfully stripped.
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1793250
|
||||
|
||||
test $(stat -L -c %s $LIBLLVM_PATH) -lt 524288000
|
||||
test "$(stat -L -c %s "$LIBLLVM_PATH")" -lt 524288000
|
||||
|
||||
# Ensure libLLVM has no debug info
|
||||
[[ $(llvm-readelf -S "$LIBLLVM_PATH" | grep -c '\.debug') -eq 0 ]]
|
||||
|
|
|
|||
20
tests/libomp/main.fmf
Normal file
20
tests/libomp/main.fmf
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# The point of this test is to ensure that clang/clang-libs demand the correct
|
||||
# libomp packages, and is able to use openmp headers and libraries
|
||||
summary: test clang can find libomp header and libraries
|
||||
tier: 1
|
||||
component+:
|
||||
- libomp
|
||||
|
||||
require+:
|
||||
- clang-libs
|
||||
- libomp
|
||||
- libomp-devel
|
||||
|
||||
adjust+:
|
||||
# Right now libomp in s390x is supported only in LLVM >= 18 in Fedora
|
||||
# And in LLVM >= 19 in CentOS/RHEL
|
||||
# TODO until tmt allows to use custom adjusted contexts we need to do this
|
||||
# indirect adjustment using the distro version.
|
||||
- when: arch == s390x and distro ~< rhel-9.6.0
|
||||
enabled: false
|
||||
continue: false
|
||||
8
tests/libomp/openmp-compile-link-test.c
Normal file
8
tests/libomp/openmp-compile-link-test.c
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#include <omp.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int nthreads = omp_get_num_threads();
|
||||
printf("Num Threads: %d\n", nthreads);
|
||||
return 0;
|
||||
}
|
||||
27
tests/libomp/test.sh
Executable file
27
tests/libomp/test.sh
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -exo pipefail
|
||||
|
||||
CLANG_PKG=$(rpm -qf --queryformat '%{name}' "$(readlink -f "$(type -p clang)")")
|
||||
|
||||
# For compat packages, we want to check if there's a package suffix: clang17 instead clang for example
|
||||
PKG_SUFFIX=${CLANG_PKG#clang}
|
||||
CLANG_NVR=$(rpm -q "$CLANG_PKG")
|
||||
CLANG_VERSION=$(rpm --queryformat="%{version}" -q "$CLANG_NVR")
|
||||
LIBOMP_DEPENDENCIES="libomp${PKG_SUFFIX} libomp${PKG_SUFFIX}-devel"
|
||||
|
||||
# Ensure clang depends on the correct clang-libs version
|
||||
rpm -q --requires "$CLANG_NVR" | grep "${CLANG_PKG}-libs.* = ${CLANG_VERSION}"
|
||||
|
||||
# Check that weak dependencies are correct. The versions of these should be the same
|
||||
# as clang's to guarantee the ABI compatibility, and that version should be actually
|
||||
# installed as well.
|
||||
for lomp_dep in $LIBOMP_DEPENDENCIES; do
|
||||
rpm -q --recommends "clang${PKG_SUFFIX}-libs" | grep "${lomp_dep}.* = ${CLANG_VERSION}"
|
||||
[[ "$(rpm --queryformat="%{version}" -q "${lomp_dep}"."$(uname -m)")" == "${CLANG_VERSION}" ]]
|
||||
done
|
||||
|
||||
# Perform a sanity test to ensure everything works as expected
|
||||
clang -fopenmp openmp-compile-link-test.c
|
||||
|
||||
./a.out | grep "Num Threads: 1"
|
||||
5
tests/lld/basic/main.fmf
Normal file
5
tests/lld/basic/main.fmf
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
summary: Test lld with clang
|
||||
tier: 1
|
||||
|
||||
require+:
|
||||
- clang
|
||||
3
tests/lld/basic/test.sh
Executable file
3
tests/lld/basic/test.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh -eux
|
||||
|
||||
echo "int main(){ return 0; }" | clang -x c -fuse-ld=lld -
|
||||
4
tests/lld/gcc-compat-basic/main.fmf
Normal file
4
tests/lld/gcc-compat-basic/main.fmf
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
summary: Test lld with gcc
|
||||
require+:
|
||||
- gcc
|
||||
tier: 1
|
||||
3
tests/lld/gcc-compat-basic/test.sh
Executable file
3
tests/lld/gcc-compat-basic/test.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh -eux
|
||||
|
||||
echo "int main(){ return 0; }" | gcc -x c -fuse-ld=lld -
|
||||
12
tests/lld/ld-alternative/main.fmf
Normal file
12
tests/lld/ld-alternative/main.fmf
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
summary: Test linker switching with alternatives
|
||||
# This test spoils the installation by removing lld.
|
||||
tag+:
|
||||
- not-in-default
|
||||
require+:
|
||||
- binutils
|
||||
tier: 1
|
||||
|
||||
adjust+:
|
||||
- because: lld is not installed as ld alternative in rhel < 9
|
||||
enabled: false
|
||||
when: distro < rhel-9
|
||||
30
tests/lld/ld-alternative/test.sh
Executable file
30
tests/lld/ld-alternative/test.sh
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#!/bin/bash -eux
|
||||
|
||||
# This test assumes lld is already installed.
|
||||
|
||||
verify_ld_bfd (){
|
||||
|
||||
# Verify that /usr/bin/ld points to ld.bfd.
|
||||
[[ $(readlink -f /etc/alternatives/ld) == *"ld.bfd" ]]
|
||||
|
||||
# Run ld and verify it invokes ld.bfd
|
||||
/usr/bin/ld --version | grep 'GNU ld'
|
||||
}
|
||||
|
||||
|
||||
# Verify ld.bfd is still the system linker when lld is installed
|
||||
verify_ld_bfd
|
||||
|
||||
# Set lld as the system linker
|
||||
update-alternatives --set ld /usr/bin/ld.lld
|
||||
|
||||
# Verify that /usr/bin/ld points to lld
|
||||
[[ $(readlink -f /etc/alternatives/ld) == *"lld" ]]
|
||||
|
||||
# Run ld and verify it invokes lld
|
||||
/usr/bin/ld --version | grep 'LLD'
|
||||
|
||||
# Uninstall lld and make sure the /usr/bin/ld is reset to ld.bfd
|
||||
dnf -y remove lld
|
||||
|
||||
verify_ld_bfd
|
||||
10
tests/lld/main.fmf
Normal file
10
tests/lld/main.fmf
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# Common adjustments for lld tests
|
||||
require+:
|
||||
- lld
|
||||
|
||||
adjust+:
|
||||
- because: lld is not shipped in s390x on LLVM < 18
|
||||
enabled: false
|
||||
when: arch == s390x and distro < rhel-8.10
|
||||
- enabled: false
|
||||
when: arch == s390x and distro ~< rhel-9.5
|
||||
6
tests/lldb/lldb-dwz/hello.c
Normal file
6
tests/lldb/lldb-dwz/hello.c
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
printf("hello!\n");
|
||||
return 0;
|
||||
}
|
||||
6
tests/lldb/lldb-dwz/main.fmf
Normal file
6
tests/lldb/lldb-dwz/main.fmf
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
summary: "Test that lldb doesn't crash with dwz debuginfo"
|
||||
require+:
|
||||
- lldb
|
||||
- gcc
|
||||
- dwz
|
||||
tier: 1
|
||||
20
tests/lldb/lldb-dwz/test.sh
Executable file
20
tests/lldb/lldb-dwz/test.sh
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash -eux
|
||||
|
||||
gcc -gdwarf-4 -o hello1 hello.c
|
||||
# Copy the binary so we can create a common file for duplicated debuginfo
|
||||
cp hello1 hello2
|
||||
# dwz overwrites the binaries
|
||||
dwz hello1 hello2 -m hello.common
|
||||
lldb -b -o 'b main' -o 'run --usage' -o c -- hello1 2>&1 | tee lldb.log
|
||||
|
||||
exe=$(command -v lldb)
|
||||
# Until LLVM 23, DW_FORM GNU_ref_alt and GNU_strp_alt are unsupported.
|
||||
# In that case, lldb should report "unsupported DW_FORM values: 0x1f20 0x1f21"
|
||||
# as a warning, and continue the execution without any crash. Support added in:
|
||||
# https://github.com/llvm/llvm-project/commit/16149ca93227d0d26a2f7387e95ad30971e99f43
|
||||
if [[ "$(rpm -q --qf "%{version}" -f $exe | cut -d. -f1)" -lt "23" ]] ; then
|
||||
grep "unsupported DW_FORM values" lldb.log
|
||||
fi
|
||||
grep "stop reason = breakpoint" lldb.log
|
||||
# Ensure the process ends successfully (no crashes)
|
||||
grep -E "Process [0-9]+ exited with status = 0" lldb.log
|
||||
15
tests/lldb/lldb-std-vector-prettyprint/main.fmf
Normal file
15
tests/lldb/lldb-std-vector-prettyprint/main.fmf
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
summary: "Test lldb std::vector pretty printer"
|
||||
require+:
|
||||
- lldb
|
||||
- gcc-c++
|
||||
tier: 1
|
||||
|
||||
adjust+:
|
||||
# rhbz#2077932 rhbz#2082508
|
||||
- because: "std::vector pretty printer does not work properly in RHEL<9 due to older libstdc++"
|
||||
enabled: false
|
||||
when: distro < rhel-9
|
||||
|
||||
- because: "Python packages not shipped in compat packages, hence no prettyprinter"
|
||||
when: compat is defined
|
||||
enabled: false
|
||||
9
tests/lldb/lldb-std-vector-prettyprint/test.cpp
Normal file
9
tests/lldb/lldb-std-vector-prettyprint/test.cpp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#include <stdio.h>
|
||||
#include <vector>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
std::vector<int> v (1, 2);
|
||||
std::vector<int>::iterator it(v.begin());
|
||||
return 0;
|
||||
}
|
||||
22
tests/lldb/lldb-std-vector-prettyprint/test.sh
Executable file
22
tests/lldb/lldb-std-vector-prettyprint/test.sh
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/sh -eux
|
||||
|
||||
g++ -g test.cpp
|
||||
|
||||
lldb -b -o 'breakpoint set --file test.cpp --line 7' -o run -o 'p v' -- a.out | tee lldb.log
|
||||
|
||||
# Starting with LLVM 17.0, the expected output is:
|
||||
# (std::vector<int>) size=1 {
|
||||
# [0] = 2
|
||||
|
||||
# In LLVM 16.0, the expected output is:
|
||||
# (std::vector<int, std::allocator<(int)> >) $0 = size=1 {
|
||||
# [0] = 2
|
||||
|
||||
# shellcheck disable=SC2016
|
||||
test "$(grep -c \
|
||||
-e '(std::vector<int\(, std::allocator<\(int\)\?> \)\?>) \($0 = \)\?size=1 {' \
|
||||
-e '\[0\] = 2' \
|
||||
lldb.log \
|
||||
)" -eq 2
|
||||
|
||||
rm lldb.log
|
||||
11
tests/lldb/python-embedded-interpreter/main.fmf
Normal file
11
tests/lldb/python-embedded-interpreter/main.fmf
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
summary: "Test lldb embedded interpreter (rhbz#1567262)"
|
||||
description: "Ensure that lldb depends on python3-lldb"
|
||||
require+:
|
||||
- lldb
|
||||
- gcc-c++
|
||||
- which
|
||||
tier: 1
|
||||
adjust+:
|
||||
- because: "Python pkgs not shipped in compat, lldb should NOT depend on python3-lldb"
|
||||
result: xfail
|
||||
when: compat is defined
|
||||
9
tests/lldb/python-embedded-interpreter/test.cpp
Normal file
9
tests/lldb/python-embedded-interpreter/test.cpp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#include <stdio.h>
|
||||
#include <vector>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
int i = 1;
|
||||
float f = 1.0;
|
||||
return 0;
|
||||
}
|
||||
30
tests/lldb/python-embedded-interpreter/test.sh
Executable file
30
tests/lldb/python-embedded-interpreter/test.sh
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#!/bin/sh -eux
|
||||
|
||||
# Verify the formal side of things, lldb should really depend on its Python bits
|
||||
LLDB_PACKAGE=${LLDB_PACKAGE:-$(rpm -qf "$(which lldb)")}
|
||||
rpm -q --requires "$LLDB_PACKAGE" | grep "python3\(\.12\)\?-lldb"
|
||||
|
||||
# Sanity test
|
||||
g++ -g test.cpp
|
||||
|
||||
run_test() {
|
||||
lldb -b -o 'breakpoint set --file test.cpp --line 8' \
|
||||
-o run -o 'p i' -o 'p f'\
|
||||
-- a.out | tee lldb.log
|
||||
|
||||
# shellcheck disable=SC2016
|
||||
test "$(grep -c \
|
||||
-e '(int) \($0 = \)\?1' \
|
||||
-e '(float) \($1 = \)\?1' \
|
||||
lldb.log \
|
||||
)" -eq 2
|
||||
|
||||
rm lldb.log
|
||||
}
|
||||
|
||||
run_test
|
||||
|
||||
# Now try again inside virtualenv
|
||||
python3 -m venv venv
|
||||
source ./venv/bin/activate
|
||||
run_test
|
||||
|
|
@ -1,6 +1,3 @@
|
|||
summary: Make sure llvm-config symlink is properly set up
|
||||
tier: 1
|
||||
duration: 1m
|
||||
extra-summary: /tools/llvm/llvm-config
|
||||
extra-task: /tools/llvm/llvm-config
|
||||
extra-nitrate: TC#0614096
|
||||
|
|
|
|||
22
tests/llvm-test-suite/main.fmf
Normal file
22
tests/llvm-test-suite/main.fmf
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
summary: Run tests from llvm-test-suite package
|
||||
|
||||
tag+:
|
||||
- fedora-only
|
||||
|
||||
adjust+:
|
||||
- because: "llvm-test-suite is available for Fedora, not RHEL/CentOS"
|
||||
when: >-
|
||||
distro == rhel
|
||||
or distro == centos
|
||||
enabled: false
|
||||
|
||||
- because: "llvm test suite not built for compat packages"
|
||||
enabled: false
|
||||
when: compat is defined
|
||||
|
||||
require+:
|
||||
- clang
|
||||
- cmake
|
||||
- ninja-build
|
||||
- llvm-test-suite
|
||||
duration: 1h
|
||||
24
tests/llvm-test-suite/test.sh
Executable file
24
tests/llvm-test-suite/test.sh
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
cc="clang"
|
||||
cxx="clang++"
|
||||
testsuite_dir="/usr/share/llvm-test-suite/"
|
||||
|
||||
set -xe
|
||||
|
||||
# This test consumes almost 2GiB. This space may not be available on /tmp on
|
||||
# all servers. We need to guarantee that physical disk is used in order to
|
||||
# avoid spurious failures.
|
||||
tmpdir=$(mktemp -d -p /var/tmp llvm-test-suite.XXXXXXXXXX)
|
||||
pushd $tmpdir
|
||||
|
||||
cmake -G Ninja $testsuite_dir \
|
||||
-DCMAKE_C_COMPILER=$cc \
|
||||
-DCMAKE_CXX_COMPILER=$cxx \
|
||||
-DTEST_SUITE_LIT_FLAGS="-sv"
|
||||
|
||||
ninja -v check
|
||||
|
||||
popd
|
||||
# Remove temporary files in case of success.
|
||||
rm -rf $tmpdir
|
||||
8
tests/long-double/main.fmf
Normal file
8
tests/long-double/main.fmf
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
summary: Test that gcc and clang use the same long double format
|
||||
duration: 5m
|
||||
tier: 1
|
||||
|
||||
require+:
|
||||
- gcc
|
||||
|
||||
id: 4096a1bb-d2a5-4aeb-b14d-fc465c293e32
|
||||
15
tests/long-double/test.sh
Executable file
15
tests/long-double/test.sh
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
# Use __LDBL_MANT_DIG__ as a way to distinguish between long double formats.
|
||||
# While this is not guaranteed to change for all formats, it provides a
|
||||
# reliable enough method for testing which long double format is being used.
|
||||
# If this test fails, either gcc or clang changed the default long double
|
||||
# format, requiring to investigate why that happened and the best way to
|
||||
# solve this in the long term.
|
||||
gcc_output=$(gcc -E -dM -x c /dev/null | grep -e __LDBL_MANT_DIG__)
|
||||
clang_output=$(clang -E -dM -x c /dev/null | grep -e __LDBL_MANT_DIG__)
|
||||
|
||||
echo "gcc: $gcc_output"
|
||||
echo "clang: $clang_output"
|
||||
|
||||
test "$gcc_output" = "$clang_output"
|
||||
|
|
@ -17,41 +17,11 @@ framework: shell
|
|||
test: ./test.sh
|
||||
|
||||
# Commonly used keys are initialized to empty.
|
||||
require: []
|
||||
link: []
|
||||
tag: []
|
||||
|
||||
adjust+:
|
||||
# Common requirements when LLVM is not SCL-ized
|
||||
- require+:
|
||||
- llvm
|
||||
- llvm-libs
|
||||
- llvm-devel
|
||||
- clang
|
||||
when: collection is not defined
|
||||
|
||||
# Requirements for SCL-ized LLVM
|
||||
# We need to override the test key to do the proper scl call
|
||||
- test: scl enable llvm-toolset-13.0 -- ./test.sh
|
||||
require+:
|
||||
- llvm-toolset-13.0-llvm
|
||||
- llvm-toolset-13.0-llvm-libs
|
||||
- llvm-toolset-13.0-llvm-devel
|
||||
- llvm-toolset-13.0-clang
|
||||
when: collection == llvm-toolset-13.0
|
||||
|
||||
- test: scl enable llvm-toolset-14.0 -- ./test.sh
|
||||
require+:
|
||||
- llvm-toolset-14.0-llvm
|
||||
- llvm-toolset-14.0-llvm-libs
|
||||
- llvm-toolset-14.0-llvm-devel
|
||||
- llvm-toolset-14.0-clang
|
||||
when: collection == llvm-toolset-14.0
|
||||
|
||||
- test: scl enable llvm-toolset-15.0 -- ./test.sh
|
||||
require+:
|
||||
- llvm-toolset-15.0-llvm
|
||||
- llvm-toolset-15.0-llvm-libs
|
||||
- llvm-toolset-15.0-llvm-devel
|
||||
- llvm-toolset-15.0-clang
|
||||
when: collection == llvm-toolset-15.0
|
||||
require+:
|
||||
- llvm
|
||||
- llvm-libs
|
||||
- llvm-devel
|
||||
- clang
|
||||
|
|
|
|||
29
tests/multilib-install/main.fmf
Normal file
29
tests/multilib-install/main.fmf
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
summary: Make sure that multilib installation works
|
||||
tier: 1
|
||||
|
||||
tag+:
|
||||
- multilib
|
||||
|
||||
require+:
|
||||
- llvm-devel
|
||||
- llvm-devel.i686
|
||||
|
||||
link:
|
||||
- verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2365079
|
||||
|
||||
adjust+:
|
||||
- enabled: false
|
||||
because: "Test applicable only on x86_64 arch"
|
||||
when: arch != x86_64
|
||||
|
||||
- enabled: false
|
||||
because: "i686 packages may not be available in snapshot builds when x86_64 tests are executed"
|
||||
when: snapshot is defined
|
||||
|
||||
- enabled: false
|
||||
because: "compat packages are not compatible with multilib"
|
||||
when: compat is defined
|
||||
|
||||
- enabled: false
|
||||
because: "i686 not supported in RHEL-10 and newer"
|
||||
when: distro >= rhel-10 or distro >= centos-stream-10
|
||||
5
tests/multilib-install/test.sh
Executable file
5
tests/multilib-install/test.sh
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh -eux
|
||||
|
||||
# For now just check that installation works.
|
||||
rpm -q llvm-devel.x86_64
|
||||
rpm -q llvm-devel.i686
|
||||
16
tests/openmp-rpm/main.fmf
Normal file
16
tests/openmp-rpm/main.fmf
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
summary: Test build a simple RPM package to ensure that -fopenmp works
|
||||
require+:
|
||||
- rpm-build
|
||||
- libomp
|
||||
tier: 1
|
||||
component+:
|
||||
- libomp
|
||||
|
||||
adjust+:
|
||||
# Right now libomp in s390x is supported only in LLVM >= 18 in Fedora
|
||||
# And in LLVM >= 19 in CentOS/RHEL
|
||||
# TODO until tmt allows to use custom adjusted contexts we need to do this
|
||||
# indirect adjustment using the distro version.
|
||||
- when: arch == s390x and distro ~< rhel-9.6.0
|
||||
enabled: false
|
||||
continue: false
|
||||
7
tests/openmp-rpm/test.c
Normal file
7
tests/openmp-rpm/test.c
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
int main(int argc, char **argv) {
|
||||
int res = 1;
|
||||
#pragma omp parallel
|
||||
#pragma omp single
|
||||
res = 0;
|
||||
return res;
|
||||
}
|
||||
8
tests/openmp-rpm/test.sh
Executable file
8
tests/openmp-rpm/test.sh
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
# Do not run dnf builddep here. TMT should take care of any packages needed to
|
||||
# run the test. If the rpmbuild fails due to missing packages, then fmf metadata
|
||||
# needs to be fixed.
|
||||
QA_RPATHS=$(( 0x0001 )) rpmbuild --define "_sourcedir $PWD" -bb test.spec
|
||||
40
tests/openmp-rpm/test.spec
Normal file
40
tests/openmp-rpm/test.spec
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
%global toolchain clang
|
||||
%{?scl:%global scl_prefix %{scl}-}
|
||||
|
||||
Name: test
|
||||
Version: 1
|
||||
Release: 1
|
||||
Summary: Test package for checking that RPM packages using -fopenmp build correctly
|
||||
License: MIT
|
||||
|
||||
# Do not set buildrequires, tmt should cover any requirements to build.
|
||||
# If not, tmt test metadata must be updated.
|
||||
# BuildRequires: %{?scl_prefix}clang
|
||||
# BuildRequires: %{?scl_prefix}libomp
|
||||
|
||||
Source0: test.c
|
||||
|
||||
%global debug_package %{nil}
|
||||
|
||||
%description
|
||||
clang was adding RUNPATH to binaries that use OpenMP, and since RUNPATH
|
||||
is prohibited in Fedora builds, this was causing packages using clang
|
||||
and OpenMP to fail to build.
|
||||
|
||||
References:
|
||||
https://fedoraproject.org/wiki/Changes/Broken_RPATH_will_fail_rpmbuild
|
||||
https://github.com/llvm/llvm-project/commit/9b9d08111b618d74574ba03e5cc3d752ecc56f55
|
||||
|
||||
%build
|
||||
clang ${CFLAGS} -c %{SOURCE0} -o test.o
|
||||
clang ${LDFLAGS} -fopenmp test.o -o main
|
||||
|
||||
%check
|
||||
./main
|
||||
|
||||
%install
|
||||
install -d %{buildroot}%{_bindir}
|
||||
install main %{buildroot}%{_bindir}
|
||||
|
||||
%files
|
||||
%{_bindir}/main
|
||||
5
tests/pie-rpm/.gitignore
vendored
Normal file
5
tests/pie-rpm/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
pie
|
||||
pie-static
|
||||
pie-shared
|
||||
pie-no-pie
|
||||
pie.o
|
||||
12
tests/pie-rpm/main.fmf
Normal file
12
tests/pie-rpm/main.fmf
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
summary: Check that we build rpms with -pie
|
||||
tier: 1
|
||||
|
||||
require+:
|
||||
- clang-libs
|
||||
- rpm-build
|
||||
- glibc-static
|
||||
|
||||
adjust+:
|
||||
- enabled: false
|
||||
when: distro < rhel-10 or distro < centos-stream-10
|
||||
because: "Default linking with pie only in CentOS/RHEL 10 and newer"
|
||||
71
tests/pie-rpm/pie.spec
Normal file
71
tests/pie-rpm/pie.spec
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
%global toolchain clang
|
||||
|
||||
Name: pie
|
||||
Version: 1
|
||||
Release: %autorelease
|
||||
Summary: Check that -pie is passed.
|
||||
|
||||
License: MIT
|
||||
|
||||
BuildRequires: clang glibc-static
|
||||
|
||||
%description
|
||||
Make sure the standard configuration from redhat-rpm-config passes -pie when linking.
|
||||
|
||||
%prep
|
||||
%setup -c -T
|
||||
cat << EOF > pie.c
|
||||
int main(int argc, char **argv) {
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
|
||||
%build
|
||||
|
||||
LDFLAGS="${LDFLAGS} -Werror"
|
||||
|
||||
clang ${CFLAGS} -c pie.c -o %{NAME}.o
|
||||
|
||||
# Regular
|
||||
clang ${LDFLAGS} %{NAME}.o -o %{NAME}
|
||||
|
||||
# With -shared
|
||||
clang ${LDFLAGS} -shared %{NAME}.o -o %{NAME}-shared-pre
|
||||
clang -shared ${LDFLAGS} %{NAME}.o -o %{NAME}-shared-post
|
||||
|
||||
# With -static
|
||||
clang ${LDFLAGS} -static %{NAME}.o -o %{NAME}-static-pre
|
||||
clang -static ${LDFLAGS} %{NAME}.o -o %{NAME}-static-post
|
||||
|
||||
# With -no-pie
|
||||
clang ${LDFLAGS} -no-pie %{NAME}.o -o %{NAME}-no-pie-pre
|
||||
clang -no-pie ${LDFLAGS} %{NAME}.o -o %{NAME}-no-pie-post
|
||||
|
||||
%check
|
||||
if [[ "$(file ./pie)" != *"pie executable"* ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$(file ./pie-shared-pre)" == *"pie executable"* ]]; then
|
||||
exit 1
|
||||
fi
|
||||
if [[ "$(file ./pie-shared-post)" == *"pie executable"* ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$(file ./pie-static-pre)" == *"pie executable"* ]]; then
|
||||
exit 1
|
||||
fi
|
||||
if [[ "$(file ./pie-static-post)" == *"pie executable"* ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$(file ./pie-no-pie-pre)" == *"pie executable"* ]]; then
|
||||
exit 1
|
||||
fi
|
||||
if [[ "$(file ./pie-no-pie-post)" == *"pie executable"* ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
%changelog
|
||||
%autochangelog
|
||||
8
tests/pie-rpm/test.sh
Executable file
8
tests/pie-rpm/test.sh
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
set pipefail
|
||||
|
||||
#${BUILDDEP_CMD} -y pie.spec
|
||||
|
||||
QA_RPATHS=$(( 0x0001 )) rpmbuild -bb --nodeps ./pie.spec
|
||||
11
tests/ppc64le-long-double/exp.c
Normal file
11
tests/ppc64le-long-double/exp.c
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/* Use a libm funcion that returns well-known results depending on the long
|
||||
double format being used. */
|
||||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
printf("%La\n", expl(1.0L));
|
||||
|
||||
return 0;
|
||||
}
|
||||
24
tests/ppc64le-long-double/main.fmf
Normal file
24
tests/ppc64le-long-double/main.fmf
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
summary: Test binary compatibility of the long double format on ppc64le
|
||||
duration: 1h
|
||||
tier: 1
|
||||
|
||||
adjust+:
|
||||
- because: "Fedora CI runs in x86_64 only, emulate with qemu and mock"
|
||||
require+:
|
||||
- qemu-user-static
|
||||
- mock
|
||||
test: ./runtest-fedora.sh
|
||||
when: distro == fedora and arch == x86_64 and snapshot is not defined
|
||||
continue: false
|
||||
|
||||
- enabled: false
|
||||
when: arch != ppc64le
|
||||
|
||||
- because: "glibc in RHEL older than 9 don't support IEEE 128bit doubles"
|
||||
enabled: false
|
||||
when: distro < rhel-9 or distro < centos-stream-9
|
||||
|
||||
- because: "The test runs natively on RHEL so get gcc to build"
|
||||
require+:
|
||||
- gcc
|
||||
when: distro != fedora or snapshot is defined
|
||||
15
tests/ppc64le-long-double/parse.cpp
Normal file
15
tests/ppc64le-long-double/parse.cpp
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/* Check how the C++ standard library parses the following number correctly.
|
||||
On IBM double-double, the 7 least significant bits are messed up.
|
||||
On IEEE 128-bit long double, this number is correctly represented. */
|
||||
#include <sstream>
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
long double d;
|
||||
std::stringstream ss("0x1.5bf0a8b1457695355fb8ac404e7ap+1");
|
||||
|
||||
ss >> d;
|
||||
printf("%La\n", d);
|
||||
|
||||
return 0;
|
||||
}
|
||||
48
tests/ppc64le-long-double/runtest-fedora.sh
Executable file
48
tests/ppc64le-long-double/runtest-fedora.sh
Executable file
|
|
@ -0,0 +1,48 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
fedora_release=$(rpm -E "%{fedora}")
|
||||
mock_root=fedora-$fedora_release-ppc64le
|
||||
|
||||
mock_cmd="mock -r $mock_root --isolation=simple"
|
||||
|
||||
run_test () {
|
||||
test_name=$1
|
||||
expected=$2
|
||||
|
||||
echo "Running $test_name"
|
||||
echo "Expected output: $expected"
|
||||
actual=$($mock_cmd -q --shell "./$test_name")
|
||||
echo "Actual output: $actual"
|
||||
|
||||
if [[ "$expected" == "$actual" ]]; then
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
fi
|
||||
}
|
||||
|
||||
# Avoid running mock in unsupported environments, e.g. on a non-privileged
|
||||
# container.
|
||||
if $mock_cmd -q --shell true &> /dev/null; then
|
||||
$mock_cmd --install clang libcxx-devel
|
||||
|
||||
# glibc supports both long double types, so the following should work.
|
||||
$mock_cmd --copyin exp.c /builddir/exp.c
|
||||
$mock_cmd -q --shell -- clang -mabi=ibmlongdouble -fno-builtin exp.c -o exp-ibm -lm
|
||||
$mock_cmd -q --shell -- clang -mabi=ieeelongdouble -fno-builtin exp.c -o exp-ieee -lm
|
||||
|
||||
run_test exp-ibm "0x1.5bf0a8b1457695355fb8ac404ecp+1"
|
||||
run_test exp-ieee "0x1.5bf0a8b1457695355fb8ac404e7ap+1"
|
||||
|
||||
# Test if libc++ is providing the correct ABI.
|
||||
$mock_cmd --copyin parse.cpp /builddir/parse.cpp
|
||||
$mock_cmd -q --shell -- clang++ -stdlib=libc++ -fno-builtin parse.cpp -o parse -lm
|
||||
|
||||
if [[ $fedora_release -gt 37 ]]; then
|
||||
run_test parse "0x1.5bf0a8b1457695355fb8ac404e7ap+1"
|
||||
else
|
||||
run_test parse "0x1.5bf0a8b1457695355fb8ac404e8p+1"
|
||||
fi
|
||||
else
|
||||
echo "This environment does not support mock. This test will be ignored."
|
||||
fi
|
||||
26
tests/ppc64le-long-double/test.sh
Executable file
26
tests/ppc64le-long-double/test.sh
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
run_test () {
|
||||
test_name=$1
|
||||
expected=$2
|
||||
|
||||
echo "Running $test_name"
|
||||
echo "Expected output: $expected"
|
||||
actual=$("./$test_name")
|
||||
echo "Actual output: $actual"
|
||||
|
||||
if [[ "$expected" == "$actual" ]]; then
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
fi
|
||||
}
|
||||
|
||||
# glibc supports both long double types, so the following should work.
|
||||
clang -mabi=ibmlongdouble -fno-builtin exp.c -o exp-ibm -lm
|
||||
clang -mabi=ieeelongdouble -fno-builtin exp.c -o exp-ieee -lm
|
||||
|
||||
run_test exp-ibm "0x1.5bf0a8b1457695355fb8ac404ecp+1"
|
||||
run_test exp-ieee "0x1.5bf0a8b1457695355fb8ac404e7ap+1"
|
||||
|
||||
# TODO: Build and run the parse test when CentOS/RHEL get libc++-devel.
|
||||
16
tests/python-lit-sanity/main.fmf
Normal file
16
tests/python-lit-sanity/main.fmf
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
summary: Trivial sanity test for python-lit
|
||||
component:
|
||||
- llvm-toolset
|
||||
- python-lit
|
||||
require+:
|
||||
- python3-lit
|
||||
tier: 1
|
||||
|
||||
adjust+:
|
||||
# RHEL 8 use python3.12
|
||||
- require-:
|
||||
- python3-lit
|
||||
when: distro == rhel-8
|
||||
- require+:
|
||||
- python3.12-lit
|
||||
when: distro == rhel-8
|
||||
3
tests/python-lit-sanity/test.sh
Executable file
3
tests/python-lit-sanity/test.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#! /bin/sh -eux
|
||||
|
||||
lit --version
|
||||
15
tests/rhbz_1482491/main.fmf
Normal file
15
tests/rhbz_1482491/main.fmf
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
summary: rhbz-1482491
|
||||
description: |
|
||||
"Test that clang is able to find the right libgcc_s"
|
||||
require+:
|
||||
- libgcc
|
||||
tier: 1
|
||||
|
||||
link:
|
||||
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1482491
|
||||
|
||||
adjust+:
|
||||
# gcc-x86_64-linux-gnu is not available in RHEL
|
||||
- require+:
|
||||
- gcc-x86_64-linux-gnu
|
||||
when: "distro == fedora"
|
||||
10
tests/rhbz_1482491/test.sh
Executable file
10
tests/rhbz_1482491/test.sh
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash -eux
|
||||
|
||||
n=$(find /usr -name 'libgcc_s.so*' 2>/dev/null | wc -l)
|
||||
|
||||
if [[ $n -lt 1 ]]; then
|
||||
echo "Error: could not find libgcc_s.so"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "int main(){}" | clang -v -x c -
|
||||
6
tests/rhbz_1647130/main.fmf
Normal file
6
tests/rhbz_1647130/main.fmf
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
summary: RHBZ1647130
|
||||
description: Test that scan-build and scan-view can run without aborting
|
||||
tier: 1
|
||||
|
||||
require+:
|
||||
- clang-analyzer
|
||||
8
tests/rhbz_1647130/test.sh
Executable file
8
tests/rhbz_1647130/test.sh
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash -ex
|
||||
|
||||
tmp_cpp=$(mktemp -t XXXXX.cpp)
|
||||
tmp_dir=$(mktemp -d)
|
||||
echo 'int main(int argc, char*argv[]) { while(argc--) new int(); return 0; }' > "$tmp_cpp"
|
||||
scan-build -o "$tmp_dir" clang++ -c "$tmp_cpp" -o /dev/null
|
||||
(scan-view --no-browser "$tmp_dir"/* & WPID=$! && sleep 10s && kill $WPID)
|
||||
rm -rf "$tmp_cpp" "$tmp_dir"
|
||||
15
tests/rhbz_1657544/from_chars.cpp
Normal file
15
tests/rhbz_1657544/from_chars.cpp
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <charconv>
|
||||
#include <iostream>
|
||||
#include <cstring>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
size_t r=0;
|
||||
const char *begin = argv[1];
|
||||
const char *end = begin + strlen(begin);
|
||||
from_chars(begin, end, r);
|
||||
cout << r << '\n';
|
||||
return 0;
|
||||
}
|
||||
7
tests/rhbz_1657544/main.fmf
Normal file
7
tests/rhbz_1657544/main.fmf
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
summary: RHBZ1657544
|
||||
description: |
|
||||
Test that clang++ does not use the symbol __muloti4
|
||||
tier: 1
|
||||
|
||||
link+:
|
||||
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1657544
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue