Add a test that checks if debug information is disabled by default

In a recent change to clang 17.0.0, debug information got enabled by
default by mistake.
Add a test that helps to prevent that.
This commit is contained in:
Tulio Magno Quites Machado Filho 2023-09-19 11:57:40 -03:00
commit 0e8ca2a543
3 changed files with 37 additions and 0 deletions

25
rhbz_2239619/main.fmf Normal file
View file

@ -0,0 +1,25 @@
summary: Test if debug information is disabled by default
test: "$WITH_SCL ./runtest.sh"
require: []
framework: shell
tier: 1
component:
- llvm-toolset
- clang
adjust:
# Common requirements when LLVM is not SCL-ized
- require+:
- clang
when: "collection is not defined"
# Requirements for SCL-ized LLVM
- require+:
- llvm-toolset-13.0-clang
when: "collection == llvm-toolset-13.0"
- require+:
- llvm-toolset-14.0-clang
when: "collection == llvm-toolset-14.0"
- require+:
- llvm-toolset-15.0-clang
when: "collection == llvm-toolset-15.0"

9
rhbz_2239619/runtest.sh Executable file
View file

@ -0,0 +1,9 @@
#!/bin/sh -eux
# Ensure that compiled code does not have debug information enabled by
# default.
if clang -S test.c -o - | grep "\.section[[:space:]]\+\.debug_info"; then
echo "Error: debug information is enabled by default!" >&2
exit 1
fi

3
rhbz_2239619/test.c Normal file
View file

@ -0,0 +1,3 @@
int main(){
return 0;
}